MCPcopy
hub / github.com/pingcap/tidb / WithCurrentTime

Function WithCurrentTime

pkg/expression/exprstatic/evalctx.go:145–150  ·  view source on GitHub ↗

WithCurrentTime sets the current time for the `EvalContext`.

(fn func() (time.Time, error))

Source from the content-addressed store, hash-verified

143
144// WithCurrentTime sets the current time for the `EvalContext`.
145func WithCurrentTime(fn func() (time.Time, error)) EvalCtxOption {
146 intest.AssertNotNil(fn)
147 return func(s *evalCtxState) {
148 s.currentTime = &timeOnce{timeFn: fn}
149 }
150}
151
152// WithMaxAllowedPacket sets the value of the 'max_allowed_packet' system variable.
153func WithMaxAllowedPacket(size uint64) EvalCtxOption {

Callers 6

newLitExprContextFunction · 0.92
getEvalCtxOptionsForTestFunction · 0.85
MakeEvalContextStaticFunction · 0.85

Calls 1

AssertNotNilFunction · 0.92

Tested by 3

getEvalCtxOptionsForTestFunction · 0.68