-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
*: make SET TRANSACTION ISOLATION LEVEL READ COMMITTED take effect #3619
Conversation
c4c2ae6
to
f4ed935
Compare
tp.Charset, tp.Collate = parser.charset, parser.collation | ||
expr := ast.NewValueExpr($3) | ||
expr.SetType(tp) | ||
$$ = &ast.VariableAssignment{Name: "tx_isolation", Value: expr, IsSystem: true} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a const for tx_isolation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tx_isolation
is a session variable name.
I don't want to put it in other places except variable package.
I also don't like parser package to import variable package.
So use the string "tx_isolation" is the best compromise.
session.go
Outdated
@@ -1130,6 +1130,9 @@ func (s *session) ActivePendingTxn() error { | |||
if err != nil { | |||
return errors.Trace(err) | |||
} | |||
if s.sessionVars.Systems[variable.TxnIsolation] == "READ-COMMITTED" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use const for READ-COMMITTED.
Any need to print error when user wants to set unsupported levels? |
it is equivalent to setting "tx_isolation" variable. if the value is READ-COMMITTED, set the transaction isolation level option.
f4ed935
to
e38a2fc
Compare
Need to set |
|
LGTM |
LGTM |
it is equivalent to setting "tx_isolation" variable.
if the value is READ-COMMITTED, set the transaction isolation level option.
@disksing @zimulala @shenli