Skip to content

Commit

Permalink
Fix ts_get_now_internal to use transaction time
Browse files Browse the repository at this point in the history
Issue: #2167
  • Loading branch information
pmwkaa committed Aug 31, 2020
1 parent 4538fc6 commit c240bff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,14 +759,14 @@ ts_get_now_internal(const Dimension *open_dim)
#ifdef TS_DEBUG
Datum now_datum;
if (ts_current_timestamp_mock == NULL || strlen(ts_current_timestamp_mock) == 0)
now_datum = TimestampTzGetDatum(GetCurrentTimestamp());
now_datum = TimestampTzGetDatum(GetCurrentTransactionStartTimestamp());
else
now_datum = DirectFunctionCall3(timestamptz_in,
CStringGetDatum(ts_current_timestamp_mock),
0,
Int32GetDatum(-1));
#else
Datum now_datum = TimestampTzGetDatum(GetCurrentTimestamp());
Datum now_datum = TimestampTzGetDatum(GetCurrentTransactionStartTimestamp());
#endif
Assert(IS_TIMESTAMP_TYPE(dim_post_part_type));

Expand Down

0 comments on commit c240bff

Please sign in to comment.