MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / GetTxnTimeNoZone

Method GetTxnTimeNoZone

pkg/sql/sem/tree/eval.go:3065–3072  ·  view source on GitHub ↗

GetTxnTimeNoZone retrieves the current transaction time as per the evaluation context.

(precision time.Duration)

Source from the content-addressed store, hash-verified

3063// GetTxnTimeNoZone retrieves the current transaction time as per
3064// the evaluation context.
3065func (ctx *EvalContext) GetTxnTimeNoZone(precision time.Duration) *DTime {
3066 // TODO(knz): a zero timestamp should never be read, even during
3067 // Prepare. This will need to be addressed.
3068 if !ctx.PrepareOnly && ctx.TxnTimestamp.IsZero() {
3069 panic(errors.AssertionFailedf("zero transaction timestamp in EvalContext"))
3070 }
3071 return MakeDTime(timeofday.FromTime(ctx.GetRelativeParseTime().Round(precision)))
3072}
3073
3074// SetTxnTimestamp sets the corresponding timestamp in the EvalContext.
3075func (ctx *EvalContext) SetTxnTimestamp(ts time.Time) {

Callers

nothing calls this directly

Calls 4

GetRelativeParseTimeMethod · 0.95
FromTimeFunction · 0.92
MakeDTimeFunction · 0.85
RoundMethod · 0.45

Tested by

no test coverage detected