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

Function MakeExprContextStatic

pkg/expression/exprstatic/exprctx.go:309–327  ·  view source on GitHub ↗

MakeExprContextStatic converts the `exprctx.StaticConvertibleExprContext` to `ExprContext`.

(ctx exprctx.StaticConvertibleExprContext)

Source from the content-addressed store, hash-verified

307
308// MakeExprContextStatic converts the `exprctx.StaticConvertibleExprContext` to `ExprContext`.
309func MakeExprContextStatic(ctx exprctx.StaticConvertibleExprContext) *ExprContext {
310 staticEvalContext := MakeEvalContextStatic(ctx.GetStaticConvertibleEvalContext())
311
312 return NewExprContext(
313 WithEvalCtx(staticEvalContext),
314 WithCharset(ctx.GetCharsetInfo()),
315 WithDefaultCollationForUTF8MB4(ctx.GetDefaultCollationForUTF8MB4()),
316 WithBlockEncryptionMode(ctx.GetBlockEncryptionMode()),
317 WithSysDateIsNow(ctx.GetSysdateIsNow()),
318 WithNoopFuncsMode(ctx.GetNoopFuncsMode()),
319 WithRng(ctx.Rng()),
320 WithPlanCacheTracker(ctx.GetPlanCacheTracker()),
321 WithColumnIDAllocator(
322 exprctx.NewSimplePlanColumnIDAllocator(ctx.GetLastPlanColumnID())),
323 WithConnectionID(ctx.ConnectionID()),
324 WithWindowingUseHighPrecision(ctx.GetWindowingUseHighPrecision()),
325 WithGroupConcatMaxLen(ctx.GetGroupConcatMaxLen()),
326 )
327}
328
329// LoadSystemVars loads system variables and returns a new `EvalContext` with system variables loaded.
330func (ctx *ExprContext) LoadSystemVars(sysVars map[string]string) (*ExprContext, error) {

Callers 2

IntoStaticMethod · 0.92

Calls 15

MakeEvalContextStaticFunction · 0.85
WithEvalCtxFunction · 0.85
WithCharsetFunction · 0.85
WithBlockEncryptionModeFunction · 0.85
WithSysDateIsNowFunction · 0.85
WithNoopFuncsModeFunction · 0.85
WithRngFunction · 0.85
WithPlanCacheTrackerFunction · 0.85
WithColumnIDAllocatorFunction · 0.85
WithConnectionIDFunction · 0.85

Tested by 1