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

Method loadSessionVarsInternal

pkg/expression/exprstatic/exprctx.go:338–367  ·  view source on GitHub ↗
(
	sessionVars *variable.SessionVars, sysVars map[string]string,
)

Source from the content-addressed store, hash-verified

336}
337
338func (ctx *ExprContext) loadSessionVarsInternal(
339 sessionVars *variable.SessionVars, sysVars map[string]string,
340) *ExprContext {
341 opts := make([]ExprCtxOption, 0, 8)
342 opts = append(opts, WithEvalCtx(ctx.evalCtx.loadSessionVarsInternal(sessionVars, sysVars)))
343 for name := range sysVars {
344 name = strings.ToLower(name)
345 switch name {
346 case variable.CharacterSetConnection, variable.CollationConnection:
347 opts = append(opts, WithCharset(sessionVars.GetCharsetInfo()))
348 case variable.DefaultCollationForUTF8MB4:
349 opts = append(opts, WithDefaultCollationForUTF8MB4(sessionVars.DefaultCollationForUTF8MB4))
350 case variable.BlockEncryptionMode:
351 blockMode, ok := sessionVars.GetSystemVar(variable.BlockEncryptionMode)
352 intest.Assert(ok)
353 if ok {
354 opts = append(opts, WithBlockEncryptionMode(blockMode))
355 }
356 case variable.TiDBSysdateIsNow:
357 opts = append(opts, WithSysDateIsNow(sessionVars.SysdateIsNow))
358 case variable.TiDBEnableNoopFuncs:
359 opts = append(opts, WithNoopFuncsMode(sessionVars.NoopFuncsMode))
360 case variable.WindowingUseHighPrecision:
361 opts = append(opts, WithWindowingUseHighPrecision(sessionVars.WindowingUseHighPrecision))
362 case variable.GroupConcatMaxLen:
363 opts = append(opts, WithGroupConcatMaxLen(sessionVars.GroupConcatMaxLen))
364 }
365 }
366 return ctx.Apply(opts...)
367}

Callers 1

LoadSystemVarsMethod · 0.95

Calls 13

ApplyMethod · 0.95
AssertFunction · 0.92
WithEvalCtxFunction · 0.85
WithCharsetFunction · 0.85
WithBlockEncryptionModeFunction · 0.85
WithSysDateIsNowFunction · 0.85
WithNoopFuncsModeFunction · 0.85
WithGroupConcatMaxLenFunction · 0.85
GetSystemVarMethod · 0.80
ToLowerMethod · 0.65

Tested by

no test coverage detected