GetTxnTimestampNoZone retrieves the current transaction timestamp as per the evaluation context. The timestamp is guaranteed to be nonzero.
(precision time.Duration)
| 3038 | // GetTxnTimestampNoZone retrieves the current transaction timestamp as per |
| 3039 | // the evaluation context. The timestamp is guaranteed to be nonzero. |
| 3040 | func (ctx *EvalContext) GetTxnTimestampNoZone(precision time.Duration) *DTimestamp { |
| 3041 | // TODO(knz): a zero timestamp should never be read, even during |
| 3042 | // Prepare. This will need to be addressed. |
| 3043 | if !ctx.PrepareOnly && ctx.TxnTimestamp.IsZero() { |
| 3044 | panic(errors.AssertionFailedf("zero transaction timestamp in EvalContext")) |
| 3045 | } |
| 3046 | // Move the time to UTC, but keeping the location's time. |
| 3047 | t := ctx.GetRelativeParseTime() |
| 3048 | _, offsetSecs := t.Zone() |
| 3049 | return MakeDTimestamp(t.Add(time.Second*time.Duration(offsetSecs)).In(time.UTC), precision) |
| 3050 | } |
| 3051 | |
| 3052 | // GetTxnTime retrieves the current transaction time as per |
| 3053 | // the evaluation context. |
nothing calls this directly
no test coverage detected