(t *testing.T)
| 162 | } |
| 163 | |
| 164 | func TestMakeExprContextStatic(t *testing.T) { |
| 165 | evalCtx := NewEvalContext() |
| 166 | planCacheTracker := contextutil.NewPlanCacheTracker(evalCtx.warnHandler) |
| 167 | obj := NewExprContext( |
| 168 | WithEvalCtx(evalCtx), |
| 169 | WithCharset("a", "b"), |
| 170 | WithDefaultCollationForUTF8MB4("c"), |
| 171 | WithBlockEncryptionMode("d"), |
| 172 | WithSysDateIsNow(true), |
| 173 | WithNoopFuncsMode(1), |
| 174 | WithRng(mathutil.NewWithSeed(12345678)), |
| 175 | WithPlanCacheTracker(&planCacheTracker), |
| 176 | WithColumnIDAllocator(exprctx.NewSimplePlanColumnIDAllocator(1)), |
| 177 | WithConnectionID(1), |
| 178 | WithWindowingUseHighPrecision(false), |
| 179 | WithGroupConcatMaxLen(1), |
| 180 | ) |
| 181 | |
| 182 | ignorePath := []string{ |
| 183 | "$.exprCtxState.evalCtx**", |
| 184 | } |
| 185 | deeptest.AssertRecursivelyNotEqual(t, obj, NewExprContext(), |
| 186 | deeptest.WithIgnorePath(ignorePath), |
| 187 | deeptest.WithPointerComparePath([]string{ |
| 188 | "$.exprCtxState.rng", |
| 189 | "$.exprCtxState.planCacheTracker", |
| 190 | }), |
| 191 | ) |
| 192 | |
| 193 | staticObj := MakeExprContextStatic(obj) |
| 194 | deeptest.AssertDeepClonedEqual(t, obj, staticObj, |
| 195 | deeptest.WithIgnorePath(ignorePath), |
| 196 | deeptest.WithPointerComparePath([]string{ |
| 197 | "$.exprCtxState.rng", |
| 198 | "$.exprCtxState.planCacheTracker", |
| 199 | })) |
| 200 | |
| 201 | require.NotSame(t, obj.GetEvalCtx(), staticObj.GetEvalCtx()) |
| 202 | } |
| 203 | |
| 204 | func TestExprCtxLoadSystemVars(t *testing.T) { |
| 205 | vars := []struct { |
nothing calls this directly
no test coverage detected