mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-24 15:05:03 +08:00
Fix segfault in caggs on 32-bit systems
While DatumGetInt64 and Int64GetDatum are noops on 64-bit systems calling them on the wrong underlying type can lead to segfaults on 32-bit systems.
This commit is contained in:
parent
b355a86b4e
commit
3d880ecd2b
@ -515,7 +515,8 @@ mattablecolumninfo_create_materialization_table(MatTableColumnInfo *matcolinfo,
|
||||
/* Initialize the invalidation log for the cagg. Initially, everything is
|
||||
* invalid. */
|
||||
if (OidIsValid(origquery_tblinfo->nowfunc))
|
||||
current_time = DatumGetInt64(OidFunctionCall0(origquery_tblinfo->nowfunc));
|
||||
current_time = ts_time_value_to_internal(OidFunctionCall0(origquery_tblinfo->nowfunc),
|
||||
get_func_rettype(origquery_tblinfo->nowfunc));
|
||||
else
|
||||
current_time = GetCurrentTransactionStartTimestamp();
|
||||
|
||||
|
@ -207,10 +207,10 @@ continuous_agg_refresh_with_window(ContinuousAgg *cagg, const InternalTimeRange
|
||||
|
||||
if (client_min_messages <= DEBUG1)
|
||||
{
|
||||
Datum start_ts = ts_internal_to_time_value(DatumGetInt64(bucketed_refresh_window.start),
|
||||
refresh_window->type);
|
||||
Datum end_ts = ts_internal_to_time_value(DatumGetInt64(bucketed_refresh_window.end),
|
||||
refresh_window->type);
|
||||
Datum start_ts =
|
||||
ts_internal_to_time_value(bucketed_refresh_window.start, refresh_window->type);
|
||||
Datum end_ts =
|
||||
ts_internal_to_time_value(bucketed_refresh_window.end, refresh_window->type);
|
||||
Oid outfuncid = InvalidOid;
|
||||
bool isvarlena;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user