MCPcopy
hub / github.com/radondb/radon / isExecOnRep

Function isExecOnRep

src/proxy/execute.go:273–287  ·  view source on GitHub ↗

isExecOnRep will be called when the query is not in multi-statement txn: 1. When the query is Select, the parameter `loadBalance` can take effect. 2. By using hint can directly decide the load-balance mode, instead of check `loadBalance`.

(loadBalance int, node sqlparser.Statement)

Source from the content-addressed store, hash-verified

271// 1. When the query is Select, the parameter `loadBalance` can take effect.
272// 2. By using hint can directly decide the load-balance mode, instead of check `loadBalance`.
273func isExecOnRep(loadBalance int, node sqlparser.Statement) bool {
274 if node, ok := node.(*sqlparser.Select); ok {
275 if len(node.Comments) > 0 {
276 comment := strings.Replace(common.BytesToString(node.Comments[0]), " ", "", -1)
277 if comment == "/*+loadbalance=0*/" {
278 return false
279 }
280 if comment == "/*+loadbalance=1*/" {
281 return true
282 }
283 }
284 return loadBalance != 0
285 }
286 return false
287}

Callers 2

executeWithTimeoutMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected