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 time_bucket_ng() behavior with origin argument #3527

Merged
merged 1 commit into from Aug 26, 2021

Conversation

afiskon
Copy link
Contributor

@afiskon afiskon commented Aug 26, 2021

This PR fixes a silly bug in the time_bucket_ng() implementation:

SELECT time_bucket_ng(
'1 day',
timestamp '2021-07-12 12:34:56',
origin => timestamp '2021-06-01 00:00:00'
);

Before the patch: 2000-02-11 00:00:00
After the patch: 2021-07-12 00:00:00

The tests cath this, but we didn't notice the wrong results :(

This PR fixes a silly bug in the time_bucket_ng() implementation:

SELECT time_bucket_ng(
    '1 day',
     timestamp '2021-07-12 12:34:56',
     origin => timestamp '2021-06-01 00:00:00'
);

Before the patch:   2000-02-11 00:00:00
After the patch:    2021-07-12 00:00:00

The tests cath this, but we didn't notice the wrong results :(
@afiskon afiskon self-assigned this Aug 26, 2021
@afiskon afiskon requested a review from a team as a code owner August 26, 2021 12:15
@afiskon afiskon enabled auto-merge (rebase) August 26, 2021 12:15
@codecov
Copy link

codecov bot commented Aug 26, 2021

Codecov Report

Merging #3527 (cf8e032) into master (318d2fd) will increase coverage by 0.13%.
The diff coverage is 96.12%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3527      +/-   ##
==========================================
+ Coverage   90.56%   90.69%   +0.13%     
==========================================
  Files         211      212       +1     
  Lines       35475    36278     +803     
==========================================
+ Hits        32127    32902     +775     
- Misses       3348     3376      +28     
Impacted Files Coverage Δ
src/catalog.c 84.61% <ø> (ø)
src/catalog.h 100.00% <ø> (ø)
src/compat.h 100.00% <ø> (ø)
src/copy.c 90.40% <ø> (ø)
src/extension_utils.c 81.39% <0.00%> (ø)
src/loader/loader.c 92.17% <ø> (-0.60%) ⬇️
src/telemetry/telemetry.c 81.35% <ø> (ø)
src/utils.h 80.00% <ø> (ø)
tsl/src/bgw_policy/compression_api.c 79.83% <ø> (ø)
tsl/src/bgw_policy/reorder_api.c 94.56% <ø> (ø)
... and 69 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 6537e75...cf8e032. Read the comment docs.

@afiskon afiskon merged commit f7eceba into timescale:master Aug 26, 2021
@afiskon afiskon deleted the time_bucket_ng_origin_bugfix branch August 26, 2021 13:03
svenklemm added a commit to svenklemm/timescaledb that referenced this pull request Sep 20, 2021
This release contains bug fixes since the 2.4.1 release.
We deem it high priority to upgrade.

**Bugfixes**
* timescale#3437 Rename on all continuous aggregate objects
* timescale#3469 Use signal-safe functions in signal handler
* timescale#3520 Modify compression job processing logic
* timescale#3527 Fix time_bucket_ng behaviour with origin argument
* timescale#3532 Fix bootstrap with regresschecks disabled
* timescale#3574 Fix failure on job execution by background worker
* timescale#3590 Call cleanup functions on backend exit

**Thanks**
* @jankatins for reporting a crash with background workers
* @LutzWeischerFujitsu for reporting an issue with bootstrap
@svenklemm svenklemm mentioned this pull request Sep 20, 2021
svenklemm added a commit that referenced this pull request Sep 20, 2021
This release contains bug fixes since the 2.4.1 release.
We deem it high priority to upgrade.

**Bugfixes**
* #3437 Rename on all continuous aggregate objects
* #3469 Use signal-safe functions in signal handler
* #3520 Modify compression job processing logic
* #3527 Fix time_bucket_ng behaviour with origin argument
* #3532 Fix bootstrap with regresschecks disabled
* #3574 Fix failure on job execution by background worker
* #3590 Call cleanup functions on backend exit

**Thanks**
* @jankatins for reporting a crash with background workers
* @LutzWeischerFujitsu for reporting an issue with bootstrap
svenklemm added a commit that referenced this pull request Sep 20, 2021
This release contains bug fixes since the 2.4.1 release.
We deem it high priority to upgrade.

**Bugfixes**
* #3437 Rename on all continuous aggregate objects
* #3469 Use signal-safe functions in signal handler
* #3520 Modify compression job processing logic
* #3527 Fix time_bucket_ng behaviour with origin argument
* #3532 Fix bootstrap with regresschecks disabled
* #3574 Fix failure on job execution by background worker
* #3590 Call cleanup functions on backend exit

**Thanks**
* @jankatins for reporting a crash with background workers
* @LutzWeischerFujitsu for reporting an issue with bootstrap
svenklemm added a commit that referenced this pull request Sep 20, 2021
This release contains bug fixes since the 2.4.1 release.
We deem it high priority to upgrade.

**Bugfixes**
* #3437 Rename on all continuous aggregate objects
* #3469 Use signal-safe functions in signal handler
* #3520 Modify compression job processing logic
* #3527 Fix time_bucket_ng behaviour with origin argument
* #3532 Fix bootstrap with regresschecks disabled
* #3574 Fix failure on job execution by background worker
* #3590 Call cleanup functions on backend exit

**Thanks**
* @jankatins for reporting a crash with background workers
* @LutzWeischerFujitsu for reporting an issue with bootstrap
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