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

Function getExprCtxOptionsForTest

pkg/expression/exprstatic/exprctx_test.go:91–113  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

89}
90
91func getExprCtxOptionsForTest() ([]ExprCtxOption, *exprCtxOptionsTestState) {
92 s := &exprCtxOptionsTestState{
93 evalCtx: NewEvalContext(WithLocation(time.FixedZone("UTC+11", 11*3600))),
94 colIDAlloc: exprctx.NewSimplePlanColumnIDAllocator(1024),
95 rng: mathutil.NewWithSeed(12345678),
96 }
97 planCacheTracker := contextutil.NewPlanCacheTracker(s.evalCtx)
98
99 return []ExprCtxOption{
100 WithEvalCtx(s.evalCtx),
101 WithCharset("gbk", "gbk_bin"),
102 WithDefaultCollationForUTF8MB4("utf8mb4_0900_ai_ci"),
103 WithBlockEncryptionMode("aes-256-cbc"),
104 WithSysDateIsNow(true),
105 WithNoopFuncsMode(variable.WarnInt),
106 WithRng(s.rng),
107 WithPlanCacheTracker(&planCacheTracker),
108 WithColumnIDAllocator(s.colIDAlloc),
109 WithConnectionID(778899),
110 WithWindowingUseHighPrecision(false),
111 WithGroupConcatMaxLen(2233445566),
112 }, s
113}
114
115func checkOptionsStaticExprCtx(t *testing.T, ctx *ExprContext, s *exprCtxOptionsTestState) {
116 require.Same(t, s.evalCtx, ctx.GetEvalCtx())

Callers 2

TestNewStaticExprCtxFunction · 0.85

Calls 15

NewWithSeedFunction · 0.92
WithLocationFunction · 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

Tested by

no test coverage detected