Skip to content

Commit 5375c05

Browse files
committed
Version 3
1 parent 814754f commit 5375c05

File tree

10 files changed

+1468
-1538
lines changed

10 files changed

+1468
-1538
lines changed

test/expected/drop_rename_hypertable.out

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ SELECT * FROM _timescaledb_catalog.hypertable;
204204
_timescaledb_catalog | continuous_agg | table | super_user
205205
_timescaledb_catalog | continuous_agg_migrate_plan | table | super_user
206206
_timescaledb_catalog | continuous_agg_migrate_plan_step | table | super_user
207-
_timescaledb_catalog | continuous_aggs_bucket_function | table | super_user
208207
_timescaledb_catalog | continuous_aggs_hypertable_invalidation_log | table | super_user
209208
_timescaledb_catalog | continuous_aggs_invalidation_threshold | table | super_user
210209
_timescaledb_catalog | continuous_aggs_materialization_invalidation_log | table | super_user
@@ -215,7 +214,7 @@ SELECT * FROM _timescaledb_catalog.hypertable;
215214
_timescaledb_catalog | metadata | table | super_user
216215
_timescaledb_catalog | tablespace | table | super_user
217216
_timescaledb_catalog | telemetry_event | table | super_user
218-
(21 rows)
217+
(20 rows)
219218

220219
\dt "_timescaledb_internal".*
221220
List of relations

tsl/src/continuous_aggs/utils.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -324,14 +324,12 @@ build_const_value_for_origin(TimeBucketInfoContext *context, Oid origin_type)
324324
case TIMESTAMPOID:
325325
const_datum =
326326
DirectFunctionCall1(timestamptz_timestamp,
327-
TimestampTzGetDatum(
328-
context->bucket_time_origin_to_replace));
327+
TimestampTzGetDatum(context->bucket_time_origin_to_replace));
329328
break;
330329
case DATEOID:
331330
const_datum =
332331
DirectFunctionCall1(timestamptz_date,
333-
TimestampTzGetDatum(
334-
context->bucket_time_origin_to_replace));
332+
TimestampTzGetDatum(context->bucket_time_origin_to_replace));
335333
break;
336334
default:
337335
elog(ERROR,
@@ -462,13 +460,13 @@ continuous_agg_replace_function(ContinuousAgg *cagg, Oid function_to_replace,
462460
TimestampTz bucket_time_origin_to_replace,
463461
bool need_parameter_order_change)
464462
{
465-
TimeBucketInfoContext context = {
466-
.cagg = cagg,
467-
.function_to_replace = function_to_replace,
468-
.origin_added_during_migration = origin_added_during_migration,
469-
.bucket_time_origin_to_replace = bucket_time_origin_to_replace,
470-
.need_parameter_order_change = need_parameter_order_change
471-
};
463+
TimeBucketInfoContext context = { .cagg = cagg,
464+
.function_to_replace = function_to_replace,
465+
.origin_added_during_migration =
466+
origin_added_during_migration,
467+
.bucket_time_origin_to_replace =
468+
bucket_time_origin_to_replace,
469+
.need_parameter_order_change = need_parameter_order_change };
472470

473471
/* Rewrite the direct_view */
474472
Oid direct_view_oid = ts_get_relation_relid(NameStr(cagg->data.direct_view_schema),
@@ -598,7 +596,7 @@ continuous_agg_migrate_to_time_bucket(PG_FUNCTION_ARGS)
598596
/* Update the time_bucket_fuction */
599597
cagg->bucket_function->bucket_function = new_bucket_function;
600598
bool origin_added_during_migration = false;
601-
TimestampTz bucket_time_origin_to_replace;
599+
TimestampTz bucket_time_origin_to_replace = 0;
602600

603601
/* Set new origin if not already present in the function definition. This is needed since
604602
* time_bucket and time_bucket_ng use different origin default values.

tsl/test/expected/cagg_query-14.out

Lines changed: 211 additions & 221 deletions
Large diffs are not rendered by default.

tsl/test/expected/cagg_query-15.out

Lines changed: 211 additions & 221 deletions
Large diffs are not rendered by default.

tsl/test/expected/cagg_query-16.out

Lines changed: 211 additions & 221 deletions
Large diffs are not rendered by default.

tsl/test/expected/cagg_query-17.out

Lines changed: 211 additions & 221 deletions
Large diffs are not rendered by default.

tsl/test/expected/cagg_query_using_merge-15.out

Lines changed: 203 additions & 213 deletions
Large diffs are not rendered by default.

tsl/test/expected/cagg_query_using_merge-16.out

Lines changed: 203 additions & 213 deletions
Large diffs are not rendered by default.

tsl/test/expected/cagg_query_using_merge-17.out

Lines changed: 203 additions & 213 deletions
Large diffs are not rendered by default.

tsl/test/sql/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,12 @@ if((${PG_VERSION_MAJOR} GREATER_EQUAL "15"))
167167
merge_compress.sql)
168168
endif()
169169

170+
if((${PG_VERSION_MAJOR} GREATER_EQUAL "15"))
171+
list(APPEND TEST_TEMPLATES cagg_query_using_merge.sql.in)
172+
endif()
173+
170174
if((${PG_VERSION_MAJOR} GREATER_EQUAL "16"))
171175
list(APPEND TEST_FILES cagg_planning.sql hypercore_parallel.sql)
172-
list(APPEND TEST_TEMPLATES cagg_query_using_merge.sql.in)
173176
endif()
174177

175178
if((${PG_VERSION_MAJOR} GREATER_EQUAL "17"))

0 commit comments

Comments
 (0)