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 subtract_integer_from_now on 32-bit platforms and improve error handling #3938

Merged
merged 4 commits into from Dec 20, 2021

Conversation

svenklemm
Copy link
Member

@svenklemm svenklemm commented Dec 16, 2021

This would trigger an assert when called on a hypertable without
integer time dimension. Found by sqlsmith.

Disable-check: commit-count

@svenklemm svenklemm requested a review from a team as a code owner December 16, 2021 22:20
@codecov
Copy link

codecov bot commented Dec 16, 2021

Codecov Report

Merging #3938 (169038b) into master (a760887) will decrease coverage by 0.00%.
The diff coverage is 95.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3938      +/-   ##
==========================================
- Coverage   90.72%   90.72%   -0.01%     
==========================================
  Files         213      213              
  Lines       38445    38458      +13     
==========================================
+ Hits        34881    34892      +11     
- Misses       3564     3566       +2     
Impacted Files Coverage Δ
tsl/src/bgw_policy/policy_utils.c 81.25% <50.00%> (-1.36%) ⬇️
src/chunk.c 95.88% <100.00%> (+0.07%) ⬆️
src/hypertable.c 88.08% <100.00%> (+0.02%) ⬆️
src/utils.c 80.57% <100.00%> (+0.68%) ⬆️
tsl/src/bgw_policy/reorder_api.c 94.68% <100.00%> (+0.11%) ⬆️
tsl/src/continuous_aggs/create.c 96.10% <100.00%> (+<0.01%) ⬆️
src/loader/bgw_message_queue.c 85.52% <0.00%> (-2.64%) ⬇️

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 a760887...169038b. Read the comment docs.

@svenklemm svenklemm force-pushed the subtract_integer_from_now branch 8 times, most recently from e53adb8 to ad2e723 Compare December 18, 2021 03:35
@svenklemm svenklemm changed the title Improve error handling in subtract_integer_from_now Fix subtract_integer_from_now on 32-bit platform and improve error handling Dec 18, 2021
@svenklemm svenklemm changed the title Fix subtract_integer_from_now on 32-bit platform and improve error handling Fix subtract_integer_from_now on 32-bit platforms and improve error handling Dec 18, 2021
This patch fixes subtract_integer_from_now on 32-bit platforms,
improves error handling and adds some basic tests.
subtract_integer_from_now would trigger an assert when called
on a hypertable without integer time dimension (found by sqlsmith).
Additionally subtract_integer_from_now would segfault when called
on a hypertable without partitioning dimensions.
This patch fixes a segfault when calling show_chunks on internal
compressed hypertable and a cache lookup failure for drop_chunks
when calling on internal compressed hypertable.
When trying to create a continuous aggregate on the internal
compression hypertable a segfault would occur. This patch adds
a check for this to the cagg validation logic and prevents creating
cagg on the internal compressed hypertable.
When trying to add reorder policy to internal compressed hypertable
add_reorder_policy would segfault.
@svenklemm svenklemm self-assigned this Dec 20, 2021
@svenklemm svenklemm merged commit 0deffe2 into timescale:master Dec 20, 2021
svenklemm added a commit to svenklemm/timescaledb that referenced this pull request Feb 8, 2022
This release contains bug fixes since the 2.5.1 release.
We deem it high priority to upgrade.

**Bugfixes**
* timescale#3918 Fix DataNodeScan plans with one-time filter
* timescale#3938 Fix subtract_integer_from_now on 32-bit platforms and improve error handling
* timescale#3939 Fix projection handling in time_bucket_gapfill
* timescale#3979 Fix deparsing of index predicates
* timescale#4020 Fix ALTER TABLE EventTrigger initialization
* timescale#4024 Fix premature cache release call

**Thanks**
* @erikhh for reporting an issue with time_bucket_gapfill
* @kancsuki for reporting drop column and partial index creation not working
@svenklemm svenklemm mentioned this pull request Feb 8, 2022
svenklemm added a commit to svenklemm/timescaledb that referenced this pull request Feb 8, 2022
This release contains bug fixes since the 2.5.1 release.
We deem it high priority to upgrade.

**Bugfixes**
* timescale#3918 Fix DataNodeScan plans with one-time filter
* timescale#3938 Fix subtract_integer_from_now on 32-bit platforms and improve error handling
* timescale#3939 Fix projection handling in time_bucket_gapfill
* timescale#3979 Fix deparsing of index predicates
* timescale#4020 Fix ALTER TABLE EventTrigger initialization
* timescale#4024 Fix premature cache release call

**Thanks**
* @erikhh for reporting an issue with time_bucket_gapfill
* @kancsuki for reporting drop column and partial index creation not working
svenklemm added a commit to svenklemm/timescaledb that referenced this pull request Feb 8, 2022
This release contains bug fixes since the 2.5.1 release.
We deem it high priority to upgrade.

**Bugfixes**
* timescale#3918 Fix DataNodeScan plans with one-time filter
* timescale#3938 Fix subtract_integer_from_now on 32-bit platforms and improve error handling
* timescale#3939 Fix projection handling in time_bucket_gapfill
* timescale#3979 Fix deparsing of index predicates
* timescale#4020 Fix ALTER TABLE EventTrigger initialization
* timescale#4024 Fix premature cache release call

**Thanks**
* @erikhh for reporting an issue with time_bucket_gapfill
* @kancsuki for reporting drop column and partial index creation not working
svenklemm added a commit to svenklemm/timescaledb that referenced this pull request Feb 8, 2022
This release contains bug fixes since the 2.5.1 release.
We deem it high priority to upgrade.

**Bugfixes**
* timescale#3918 Fix DataNodeScan plans with one-time filter
* timescale#3938 Fix subtract_integer_from_now on 32-bit platforms and improve error handling
* timescale#3939 Fix projection handling in time_bucket_gapfill
* timescale#3979 Fix deparsing of index predicates
* timescale#4020 Fix ALTER TABLE EventTrigger initialization
* timescale#4024 Fix premature cache release call

**Thanks**
* @erikhh for reporting an issue with time_bucket_gapfill
* @kancsuki for reporting drop column and partial index creation not working
svenklemm added a commit to svenklemm/timescaledb that referenced this pull request Feb 8, 2022
This release contains bug fixes since the 2.5.1 release.
We deem it high priority to upgrade.

**Bugfixes**
* timescale#3918 Fix DataNodeScan plans with one-time filter
* timescale#3938 Fix subtract_integer_from_now on 32-bit platforms and improve error handling
* timescale#3939 Fix projection handling in time_bucket_gapfill
* timescale#3979 Fix deparsing of index predicates
* timescale#4020 Fix ALTER TABLE EventTrigger initialization
* timescale#4024 Fix premature cache release call

**Thanks**
* @erikhh for reporting an issue with time_bucket_gapfill
* @kancsuki for reporting drop column and partial index creation not working
svenklemm added a commit to svenklemm/timescaledb that referenced this pull request Feb 9, 2022
This release contains bug fixes since the 2.5.1 release.
We deem it high priority to upgrade.

**Bugfixes**
* timescale#3901 Improve custom scan node registration
* timescale#3911 Fix role type deparsing for GRANT command
* timescale#3918 Fix DataNodeScan plans with one-time filter
* timescale#3921 Fix segfault on insert into internal compressed table
* timescale#3938 Fix subtract_integer_from_now on 32-bit platforms and improve error handling
* timescale#3939 Fix projection handling in time_bucket_gapfill
* timescale#3948 Avoid double PGclear() in data fetchers
* timescale#3979 Fix deparsing of index predicates
* timescale#4020 Fix ALTER TABLE EventTrigger initialization
* timescale#4024 Fix premature cache release call
* timescale#4037 Fix status for dropped chunks that have catalog entries
* timescale#4069 Fix riinfo NULL handling in ANY construct

* @carlocperez for reporting crash with NULL handling in ANY construct
* @erikhh for reporting an issue with time_bucket_gapfill
* @kancsuki for reporting drop column and partial index creation not working
* @mmouterde for reporting an issue with floats and interpolate
svenklemm added a commit to svenklemm/timescaledb that referenced this pull request Feb 9, 2022
This release contains bug fixes since the 2.5.1 release.
We deem it high priority to upgrade.

**Bugfixes**
* timescale#3901 Improve custom scan node registration
* timescale#3911 Fix role type deparsing for GRANT command
* timescale#3918 Fix DataNodeScan plans with one-time filter
* timescale#3921 Fix segfault on insert into internal compressed table
* timescale#3938 Fix subtract_integer_from_now on 32-bit platforms and improve error handling
* timescale#3939 Fix projection handling in time_bucket_gapfill
* timescale#3948 Avoid double PGclear() in data fetchers
* timescale#3979 Fix deparsing of index predicates
* timescale#4020 Fix ALTER TABLE EventTrigger initialization
* timescale#4024 Fix premature cache release call
* timescale#4037 Fix status for dropped chunks that have catalog entries
* timescale#4069 Fix riinfo NULL handling in ANY construct

**Thanks**
* @carlocperez for reporting crash with NULL handling in ANY construct
* @erikhh for reporting an issue with time_bucket_gapfill
* @kancsuki for reporting drop column and partial index creation not working
* @mmouterde for reporting an issue with floats and interpolate
* Pedro Gallegos for reporting a possible privilege escalation during extension installation

Security: CVE-2022-24128
svenklemm added a commit to svenklemm/timescaledb that referenced this pull request Feb 9, 2022
This release contains bug fixes since the 2.5.1 release.
This release is high priority for upgrade. We strongly recommend that you
upgrade as soon as possible.

**Bugfixes**
* timescale#3901 Improve custom scan node registration
* timescale#3911 Fix role type deparsing for GRANT command
* timescale#3918 Fix DataNodeScan plans with one-time filter
* timescale#3921 Fix segfault on insert into internal compressed table
* timescale#3938 Fix subtract_integer_from_now on 32-bit platforms and improve error handling
* timescale#3939 Fix projection handling in time_bucket_gapfill
* timescale#3948 Avoid double PGclear() in data fetchers
* timescale#3979 Fix deparsing of index predicates
* timescale#4020 Fix ALTER TABLE EventTrigger initialization
* timescale#4024 Fix premature cache release call
* timescale#4037 Fix status for dropped chunks that have catalog entries
* timescale#4069 Fix riinfo NULL handling in ANY construct
* timescale#4071 Fix extension installation privilege escalation

**Thanks**
* @carlocperez for reporting crash with NULL handling in ANY construct
* @erikhh for reporting an issue with time_bucket_gapfill
* @kancsuki for reporting drop column and partial index creation not working
* @mmouterde for reporting an issue with floats and interpolate
* Pedro Gallegos for reporting a possible privilege escalation during extension installation

Security: CVE-2022-24128
svenklemm added a commit to svenklemm/timescaledb that referenced this pull request Feb 9, 2022
This release contains bug fixes since the 2.5.1 release.
This release is high priority for upgrade. We strongly recommend that you
upgrade as soon as possible.

**Bugfixes**
* timescale#3900 Improve custom scan node registration
* timescale#3911 Fix role type deparsing for GRANT command
* timescale#3918 Fix DataNodeScan plans with one-time filter
* timescale#3921 Fix segfault on insert into internal compressed table
* timescale#3938 Fix subtract_integer_from_now on 32-bit platforms and improve error handling
* timescale#3939 Fix projection handling in time_bucket_gapfill
* timescale#3948 Avoid double PGclear() in data fetchers
* timescale#3979 Fix deparsing of index predicates
* timescale#4015 Eliminate float rounding instabilities in interpolate
* timescale#4020 Fix ALTER TABLE EventTrigger initialization
* timescale#4024 Fix premature cache release call
* timescale#4037 Fix status for dropped chunks that have catalog entries
* timescale#4069 Fix riinfo NULL handling in ANY construct
* timescale#4071 Fix extension installation privilege escalation
* timescale#4073 Fix buffer overflow in partition scheme

**Thanks**
* @carlocperez for reporting crash with NULL handling in ANY construct
* @erikhh for reporting an issue with time_bucket_gapfill
* @fvannee for reporting a first/last memory leak
* @kancsuki for reporting drop column and partial index creation not working
* @mmouterde for reporting an issue with floats and interpolate
* Pedro Gallegos for reporting a possible privilege escalation during extension installation

Security: CVE-2022-24128
svenklemm added a commit that referenced this pull request Feb 9, 2022
This release contains bug fixes since the 2.5.1 release.
This release is high priority for upgrade. We strongly recommend that you
upgrade as soon as possible.

**Bugfixes**
* #3900 Improve custom scan node registration
* #3911 Fix role type deparsing for GRANT command
* #3918 Fix DataNodeScan plans with one-time filter
* #3921 Fix segfault on insert into internal compressed table
* #3938 Fix subtract_integer_from_now on 32-bit platforms and improve error handling
* #3939 Fix projection handling in time_bucket_gapfill
* #3948 Avoid double PGclear() in data fetchers
* #3979 Fix deparsing of index predicates
* #4015 Eliminate float rounding instabilities in interpolate
* #4020 Fix ALTER TABLE EventTrigger initialization
* #4024 Fix premature cache release call
* #4037 Fix status for dropped chunks that have catalog entries
* #4069 Fix riinfo NULL handling in ANY construct
* #4071 Fix extension installation privilege escalation
* #4073 Fix buffer overflow in partition scheme

**Thanks**
* @carlocperez for reporting crash with NULL handling in ANY construct
* @erikhh for reporting an issue with time_bucket_gapfill
* @fvannee for reporting a first/last memory leak
* @kancsuki for reporting drop column and partial index creation not working
* @mmouterde for reporting an issue with floats and interpolate
* Pedro Gallegos for reporting a possible privilege escalation during extension installation

Security: CVE-2022-24128
svenklemm added a commit that referenced this pull request Feb 9, 2022
This release contains bug fixes since the 2.5.1 release.
This release is high priority for upgrade. We strongly recommend that you
upgrade as soon as possible.

**Bugfixes**
* #3900 Improve custom scan node registration
* #3911 Fix role type deparsing for GRANT command
* #3918 Fix DataNodeScan plans with one-time filter
* #3921 Fix segfault on insert into internal compressed table
* #3938 Fix subtract_integer_from_now on 32-bit platforms and improve error handling
* #3939 Fix projection handling in time_bucket_gapfill
* #3948 Avoid double PGclear() in data fetchers
* #3979 Fix deparsing of index predicates
* #4015 Eliminate float rounding instabilities in interpolate
* #4020 Fix ALTER TABLE EventTrigger initialization
* #4024 Fix premature cache release call
* #4037 Fix status for dropped chunks that have catalog entries
* #4069 Fix riinfo NULL handling in ANY construct
* #4071 Fix extension installation privilege escalation
* #4073 Fix buffer overflow in partition scheme

**Thanks**
* @carlocperez for reporting crash with NULL handling in ANY construct
* @erikhh for reporting an issue with time_bucket_gapfill
* @fvannee for reporting a first/last memory leak
* @kancsuki for reporting drop column and partial index creation not working
* @mmouterde for reporting an issue with floats and interpolate
* Pedro Gallegos for reporting a possible privilege escalation during extension installation

Security: CVE-2022-24128
svenklemm added a commit that referenced this pull request Feb 9, 2022
This release contains bug fixes since the 2.5.1 release.
This release is high priority for upgrade. We strongly recommend that you
upgrade as soon as possible.

**Bugfixes**
* #3900 Improve custom scan node registration
* #3911 Fix role type deparsing for GRANT command
* #3918 Fix DataNodeScan plans with one-time filter
* #3921 Fix segfault on insert into internal compressed table
* #3938 Fix subtract_integer_from_now on 32-bit platforms and improve error handling
* #3939 Fix projection handling in time_bucket_gapfill
* #3948 Avoid double PGclear() in data fetchers
* #3979 Fix deparsing of index predicates
* #4015 Eliminate float rounding instabilities in interpolate
* #4020 Fix ALTER TABLE EventTrigger initialization
* #4024 Fix premature cache release call
* #4037 Fix status for dropped chunks that have catalog entries
* #4069 Fix riinfo NULL handling in ANY construct
* #4071 Fix extension installation privilege escalation
* #4073 Fix buffer overflow in partition scheme

**Thanks**
* @carlocperez for reporting crash with NULL handling in ANY construct
* @erikhh for reporting an issue with time_bucket_gapfill
* @fvannee for reporting a first/last memory leak
* @kancsuki for reporting drop column and partial index creation not working
* @mmouterde for reporting an issue with floats and interpolate
* Pedro Gallegos for reporting a possible privilege escalation during extension installation

Security: CVE-2022-24128
svenklemm added a commit that referenced this pull request Feb 9, 2022
This release contains bug fixes since the 2.5.1 release.
This release is high priority for upgrade. We strongly recommend that you
upgrade as soon as possible.

**Bugfixes**
* #3900 Improve custom scan node registration
* #3911 Fix role type deparsing for GRANT command
* #3918 Fix DataNodeScan plans with one-time filter
* #3921 Fix segfault on insert into internal compressed table
* #3938 Fix subtract_integer_from_now on 32-bit platforms and improve error handling
* #3939 Fix projection handling in time_bucket_gapfill
* #3948 Avoid double PGclear() in data fetchers
* #3979 Fix deparsing of index predicates
* #4015 Eliminate float rounding instabilities in interpolate
* #4020 Fix ALTER TABLE EventTrigger initialization
* #4024 Fix premature cache release call
* #4037 Fix status for dropped chunks that have catalog entries
* #4069 Fix riinfo NULL handling in ANY construct
* #4071 Fix extension installation privilege escalation
* #4073 Fix buffer overflow in partition scheme

**Thanks**
* @carlocperez for reporting crash with NULL handling in ANY construct
* @erikhh for reporting an issue with time_bucket_gapfill
* @fvannee for reporting a first/last memory leak
* @kancsuki for reporting drop column and partial index creation not working
* @mmouterde for reporting an issue with floats and interpolate
* Pedro Gallegos for reporting a possible privilege escalation during extension installation

Security: CVE-2022-24128
svenklemm added a commit that referenced this pull request Feb 9, 2022
This release contains bug fixes since the 2.5.1 release.
This release is high priority for upgrade. We strongly recommend that you
upgrade as soon as possible.

**Bugfixes**
* #3900 Improve custom scan node registration
* #3911 Fix role type deparsing for GRANT command
* #3918 Fix DataNodeScan plans with one-time filter
* #3921 Fix segfault on insert into internal compressed table
* #3938 Fix subtract_integer_from_now on 32-bit platforms and improve error handling
* #3939 Fix projection handling in time_bucket_gapfill
* #3948 Avoid double PGclear() in data fetchers
* #3979 Fix deparsing of index predicates
* #4015 Eliminate float rounding instabilities in interpolate
* #4020 Fix ALTER TABLE EventTrigger initialization
* #4024 Fix premature cache release call
* #4037 Fix status for dropped chunks that have catalog entries
* #4069 Fix riinfo NULL handling in ANY construct
* #4071 Fix extension installation privilege escalation

**Thanks**
* @carlocperez for reporting crash with NULL handling in ANY construct
* @erikhh for reporting an issue with time_bucket_gapfill
* @fvannee for reporting a first/last memory leak
* @kancsuki for reporting drop column and partial index creation not working
* @mmouterde for reporting an issue with floats and interpolate
* Pedro Gallegos for reporting a possible privilege escalation during extension installation

Security: CVE-2022-24128
svenklemm added a commit that referenced this pull request Feb 9, 2022
This release contains bug fixes since the 2.5.1 release.
This release is high priority for upgrade. We strongly recommend that you
upgrade as soon as possible.

**Bugfixes**
* #3900 Improve custom scan node registration
* #3911 Fix role type deparsing for GRANT command
* #3918 Fix DataNodeScan plans with one-time filter
* #3921 Fix segfault on insert into internal compressed table
* #3938 Fix subtract_integer_from_now on 32-bit platforms and improve error handling
* #3939 Fix projection handling in time_bucket_gapfill
* #3948 Avoid double PGclear() in data fetchers
* #3979 Fix deparsing of index predicates
* #4015 Eliminate float rounding instabilities in interpolate
* #4020 Fix ALTER TABLE EventTrigger initialization
* #4024 Fix premature cache release call
* #4037 Fix status for dropped chunks that have catalog entries
* #4069 Fix riinfo NULL handling in ANY construct
* #4071 Fix extension installation privilege escalation

**Thanks**
* @carlocperez for reporting crash with NULL handling in ANY construct
* @erikhh for reporting an issue with time_bucket_gapfill
* @fvannee for reporting a first/last memory leak
* @kancsuki for reporting drop column and partial index creation not working
* @mmouterde for reporting an issue with floats and interpolate
* Pedro Gallegos for reporting a possible privilege escalation during extension installation

Security: CVE-2022-24128
svenklemm added a commit that referenced this pull request Feb 9, 2022
This release contains bug fixes since the 2.5.1 release.
This release is high priority for upgrade. We strongly recommend that you
upgrade as soon as possible.

**Bugfixes**
* #3900 Improve custom scan node registration
* #3911 Fix role type deparsing for GRANT command
* #3918 Fix DataNodeScan plans with one-time filter
* #3921 Fix segfault on insert into internal compressed table
* #3938 Fix subtract_integer_from_now on 32-bit platforms and improve error handling
* #3939 Fix projection handling in time_bucket_gapfill
* #3948 Avoid double PGclear() in data fetchers
* #3979 Fix deparsing of index predicates
* #4015 Eliminate float rounding instabilities in interpolate
* #4020 Fix ALTER TABLE EventTrigger initialization
* #4024 Fix premature cache release call
* #4037 Fix status for dropped chunks that have catalog entries
* #4069 Fix riinfo NULL handling in ANY construct
* #4071 Fix extension installation privilege escalation

**Thanks**
* @carlocperez for reporting crash with NULL handling in ANY construct
* @erikhh for reporting an issue with time_bucket_gapfill
* @fvannee for reporting a first/last memory leak
* @kancsuki for reporting drop column and partial index creation not working
* @mmouterde for reporting an issue with floats and interpolate
* Pedro Gallegos for reporting a possible privilege escalation during extension installation

Security: CVE-2022-24128
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.

None yet

3 participants