Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: support pessimistic transaction (experimental feature) #10297

Merged
merged 13 commits into from May 11, 2019

use default

  • Loading branch information...
coocood committed Apr 30, 2019
commit 1c454dfae5eb103a8739160cc81f5e6c105337f9
@@ -304,7 +304,7 @@ func (e *SimpleExec) executeBegin(ctx context.Context, s *ast.BeginStmt) error {
e.ctx.GetSessionVars().SetStatusFlag(mysql.ServerStatusInTrans, true)
// Call ctx.Txn(true) to active pending txn.
pTxnConf := config.GetGlobalConfig().PessimisticTxn
if pTxnConf.Enable && s.Pessimistic {
if pTxnConf.Enable && (s.Pessimistic || pTxnConf.Default) {
e.ctx.GetSessionVars().TxnCtx.IsPessimistic = true
}
txn, err := e.ctx.Txn(true)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.