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)
| 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`. |
| 273 | func 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 | } |
no outgoing calls
no test coverage detected