-
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
*: support variable log_bin
#9343
Conversation
… test only contains session level
Codecov Report
@@ Coverage Diff @@
## master #9343 +/- ##
==========================================
- Coverage 67.14% 67.13% -0.02%
==========================================
Files 373 373
Lines 78136 78136
==========================================
- Hits 52466 52457 -9
- Misses 20973 20980 +7
- Partials 4697 4699 +2
Continue to review full report at Codecov.
|
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.
Thanks for your contribution, @aliiohs !
Please add a test case, e.g. select @@log_bin;
Rest LGTM.
LGTM |
@jackysp i already added the test case for 'log_bin' |
sessionctx/variable/varsutil.go
Outdated
@@ -340,6 +340,15 @@ func ValidateSetSystemVar(vars *SessionVars, name string, value string) (string, | |||
return "0", nil | |||
} | |||
return value, ErrWrongValueForVar.GenWithStackByArgs(name, value) | |||
case LogBin: |
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.
Could we put it to line 335? Then we can remove line344-351.
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.
LogBin need to return "ON" or "OFF", not "0" or "1"
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.
@zimulala so i will merge 'LogBin' and 'TiDBEnableTablePartition'
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.
No. I mean you can merge LogBin
with GeneralLog
. TiDBEnableTablePartition
has the value of AUTO
, which is different from LogBin
.
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.
The return value is "0" or “1”, is it expected? @zimulala
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.
I think it's OK. We can handle LogBin
like SQLLogBin
. Then we can remove BoolToStatusStr
.
We will handle #9357 in the next PR.
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.
ok, i will change the code later. @zimulala
sessionctx/variable/varsutil.go
Outdated
@@ -348,7 +348,7 @@ func ValidateSetSystemVar(vars *SessionVars, name string, value string) (string, | |||
return value, nil | |||
} | |||
return value, ErrWrongValueForVar.GenWithStackByArgs(name, value) | |||
case TiDBEnableTablePartition: | |||
case TiDBEnableTablePartition, LogBin: |
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.
If the log_bin == "2", the return value is "auto", is it expected?
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.
533d989
to
fe01745
Compare
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.
LGTM, @jackysp PTAL
executor/set_test.go
Outdated
@@ -15,6 +15,7 @@ package executor_test | |||
|
|||
import ( | |||
"context" | |||
"github.com/pingcap/tidb/config" |
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.
Keep the sys libs seperate with the 3rd libs. Please move it down to line 20.
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.
i already finished it
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.
LGTM
/run-all-tests |
/run-all-tests |
issue:#9201
Support log_bin
i changed some files,like:
sessionctx/variable/sysvar.go:395
sessionctx/variable/sysvar.go:751
sessionctx/variable/varsutil.go:351
executor/set_test.go:223