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

Function setOptionForTopSQL

pkg/executor/select.go:1303–1315  ·  view source on GitHub ↗
(sc *stmtctx.StatementContext, snapshot kv.Snapshot)

Source from the content-addressed store, hash-verified

1301}
1302
1303func setOptionForTopSQL(sc *stmtctx.StatementContext, snapshot kv.Snapshot) {
1304 if snapshot == nil {
1305 return
1306 }
1307 // pipelined dml may already flush in background, don't touch it to avoid race.
1308 if txn, ok := snapshot.(kv.Transaction); ok && txn.IsPipelined() {
1309 return
1310 }
1311 snapshot.SetOption(kv.ResourceGroupTagger, sc.GetResourceGroupTagger())
1312 if sc.KvExecCounter != nil {
1313 snapshot.SetOption(kv.RPCInterceptor, sc.KvExecCounter.RPCInterceptor())
1314 }
1315}
1316
1317func isWeakConsistencyRead(ctx sessionctx.Context, node ast.Node) bool {
1318 sessionVars := ctx.GetSessionVars()

Callers 8

OpenMethod · 0.85
OpenMethod · 0.85
execMethod · 0.85
backfillIndexMethod · 0.85
cleanTableIndexMethod · 0.85
execMethod · 0.85
batchCheckAndInsertMethod · 0.85

Calls 4

RPCInterceptorMethod · 0.80
IsPipelinedMethod · 0.65
SetOptionMethod · 0.65

Tested by

no test coverage detected