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 variable `log_bin` #9343

Merged
merged 21 commits into from Feb 20, 2019

Conversation

@aliiohs
Copy link
Contributor

commented Feb 18, 2019

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

aliiohs added some commits Feb 18, 2019

@codecov-io

This comment has been minimized.

Copy link

commented Feb 18, 2019

Codecov Report

Merging #9343 into master will decrease coverage by 0.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
sessionctx/variable/sysvar.go 100% <100%> (ø) ⬆️
sessionctx/variable/varsutil.go 25.92% <50%> (ø) ⬆️
ddl/session_pool.go 82.75% <0%> (-10.35%) ⬇️
store/tikv/scan.go 73.94% <0%> (-3.37%) ⬇️
ddl/delete_range.go 73.54% <0%> (-1.59%) ⬇️
expression/schema.go 93.75% <0%> (-0.79%) ⬇️
infoschema/infoschema.go 77.63% <0%> (+1.31%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e499da9...1cde77b. Read the comment docs.

@jackysp
Copy link
Member

left a comment

Thanks for your contribution, @aliiohs !
Please add a test case, e.g. select @@log_bin;
Rest LGTM.

Show resolved Hide resolved tidb-server/main.go Outdated
Show resolved Hide resolved tidb-server/main.go Outdated
Show resolved Hide resolved tidb-server/main.go Outdated

aliiohs added some commits Feb 18, 2019

@WangXiangUSTC

This comment has been minimized.

Copy link
Member

commented Feb 18, 2019

LGTM

@jackysp jackysp changed the title Support variable `log_bin` *: support variable `log_bin` Feb 18, 2019

@aliiohs

This comment has been minimized.

Copy link
Contributor Author

commented Feb 19, 2019

@jackysp i already added the test case for 'log_bin'

@@ -340,6 +340,15 @@ func ValidateSetSystemVar(vars *SessionVars, name string, value string) (string,
return "0", nil
}
return value, ErrWrongValueForVar.GenWithStackByArgs(name, value)
case LogBin:

This comment has been minimized.

Copy link
@zimulala

zimulala Feb 19, 2019

Member

Could we put it to line 335? Then we can remove line344-351.

This comment has been minimized.

Copy link
@aliiohs

aliiohs Feb 19, 2019

Author Contributor

LogBin need to return "ON" or "OFF", not "0" or "1"

This comment has been minimized.

Copy link
@aliiohs

aliiohs Feb 19, 2019

Author Contributor

@zimulala so i will merge 'LogBin' and 'TiDBEnableTablePartition'

This comment has been minimized.

Copy link
@zimulala

zimulala Feb 19, 2019

Member

No. I mean you can merge LogBin with GeneralLog. TiDBEnableTablePartition has the value of AUTO, which is different from LogBin.

This comment has been minimized.

Copy link
@aliiohs

aliiohs Feb 19, 2019

Author Contributor

The return value is "0" or “1”, is it expected? @zimulala

This comment has been minimized.

Copy link
@zimulala

zimulala Feb 19, 2019

Member

I think it's OK. We can handle LogBin like SQLLogBin. Then we can remove BoolToStatusStr.
We will handle #9357 in the next PR.

This comment has been minimized.

Copy link
@aliiohs

aliiohs Feb 19, 2019

Author Contributor

ok, i will change the code later. @zimulala

@@ -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:

This comment has been minimized.

Copy link
@winkyao

winkyao Feb 19, 2019

Member

If the log_bin == "2", the return value is "auto", is it expected?

This comment has been minimized.

Copy link
@aliiohs

aliiohs Feb 19, 2019

Author Contributor

@winkyao @zimulala I think I changed the return value to "0" and "1" is not a good way, so i want to keep it in independent case.

@aliiohs aliiohs force-pushed the aliiohs:support_log_bin_2019_02_18_1 branch from 533d989 to fe01745 Feb 19, 2019

aliiohs added some commits Feb 19, 2019

@winkyao
Copy link
Member

left a comment

LGTM, @jackysp PTAL

@@ -15,6 +15,7 @@ package executor_test

import (
"context"
"github.com/pingcap/tidb/config"

This comment has been minimized.

Copy link
@jackysp

jackysp Feb 20, 2019

Member

Keep the sys libs seperate with the 3rd libs. Please move it down to line 20.

This comment has been minimized.

Copy link
@aliiohs

aliiohs Feb 20, 2019

Author Contributor

i already finished it

@jackysp
Copy link
Member

left a comment

LGTM

@jackysp

This comment has been minimized.

Copy link
Member

commented Feb 20, 2019

/run-all-tests

@WangXiangUSTC

This comment has been minimized.

Copy link
Member

commented Feb 20, 2019

/run-all-tests

@ngaut ngaut merged commit 8f3c74c into pingcap:master Feb 20, 2019

5 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
idc-jenkins-ci-tidb/build Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

yu34po added a commit to yu34po/tidb that referenced this pull request Feb 27, 2019

@aliiohs aliiohs deleted the aliiohs:support_log_bin_2019_02_18_1 branch Mar 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.