diff --git a/.github/workflows/linux-32bit-build-and-test.yaml b/.github/workflows/linux-32bit-build-and-test.yaml index 3bbafe70f..2455b4b2c 100644 --- a/.github/workflows/linux-32bit-build-and-test.yaml +++ b/.github/workflows/linux-32bit-build-and-test.yaml @@ -29,7 +29,7 @@ jobs: ignores: append-13 debug_notice transparent_decompression-13 transparent_decompress_chunk-13 pg_dump pg_major: 13 - pg: "14.1" - ignores: append-14 debug_notice transparent_decompression-14 transparent_decompress_chunk-14 pg_dump + ignores: append-14 debug_notice transparent_decompression-14 transparent_decompress_chunk-14 pg_dump memoize pg_major: 14 steps: diff --git a/src/time_bucket.c b/src/time_bucket.c index 83b0a034b..593a71548 100644 --- a/src/time_bucket.c +++ b/src/time_bucket.c @@ -438,7 +438,7 @@ ts_time_bucket_ng_date(PG_FUNCTION_ARGS) delta = (year * 12 + month) - (origin_year * 12 + origin_month); bucket_number = delta / interval->month; - year = origin_year + (bucket_number * interval->month) / 12; + year = origin_year + (origin_month - 1 + bucket_number * interval->month) / 12; month = (((origin_year * 12 + (origin_month - 1)) + (bucket_number * interval->month)) % 12) + 1; diff --git a/test/expected/timestamp.out b/test/expected/timestamp.out index b378f49d7..f19d2a486 100644 --- a/test/expected/timestamp.out +++ b/test/expected/timestamp.out @@ -1630,13 +1630,13 @@ FROM generate_series('2020-01-01' :: date, '2020-12-01', '1 month') AS ts, unnest(array[ts :: date]) AS d; d | m1 | m2 | m3 | m4 | m5 ------------+------------+------------+------------+------------+------------ - 2020-01-01 | 2019-01-01 | 2019-01-01 | 2019-11-01 | 2019-01-01 | 2019-10-01 - 2020-02-01 | 2019-02-01 | 2019-01-01 | 2019-02-01 | 2019-01-01 | 2019-10-01 - 2020-03-01 | 2019-03-01 | 2019-03-01 | 2019-02-01 | 2019-01-01 | 2019-03-01 - 2020-04-01 | 2019-04-01 | 2019-03-01 | 2019-02-01 | 2019-01-01 | 2019-03-01 - 2020-05-01 | 2020-05-01 | 2020-05-01 | 2020-05-01 | 2020-05-01 | 2019-03-01 - 2020-06-01 | 2020-06-01 | 2020-05-01 | 2020-05-01 | 2020-05-01 | 2019-03-01 - 2020-07-01 | 2020-07-01 | 2020-07-01 | 2020-05-01 | 2020-05-01 | 2019-03-01 + 2020-01-01 | 2020-01-01 | 2020-01-01 | 2019-11-01 | 2020-01-01 | 2019-10-01 + 2020-02-01 | 2020-02-01 | 2020-01-01 | 2020-02-01 | 2020-01-01 | 2019-10-01 + 2020-03-01 | 2020-03-01 | 2020-03-01 | 2020-02-01 | 2020-01-01 | 2020-03-01 + 2020-04-01 | 2020-04-01 | 2020-03-01 | 2020-02-01 | 2020-01-01 | 2020-03-01 + 2020-05-01 | 2020-05-01 | 2020-05-01 | 2020-05-01 | 2020-05-01 | 2020-03-01 + 2020-06-01 | 2020-06-01 | 2020-05-01 | 2020-05-01 | 2020-05-01 | 2020-03-01 + 2020-07-01 | 2020-07-01 | 2020-07-01 | 2020-05-01 | 2020-05-01 | 2020-03-01 2020-08-01 | 2020-08-01 | 2020-07-01 | 2020-08-01 | 2020-05-01 | 2020-08-01 2020-09-01 | 2020-09-01 | 2020-09-01 | 2020-08-01 | 2020-09-01 | 2020-08-01 2020-10-01 | 2020-10-01 | 2020-09-01 | 2020-08-01 | 2020-09-01 | 2020-08-01