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

Add a tidb_version() function to show tidb-server info #3592

Merged
merged 11 commits into from Jul 17, 2017

Conversation

Projects
None yet
4 participants
@shenli
Member

shenli commented Jul 1, 2017

This is a better way to get tidb-server version than running tidb-server -V.
I will rewrite this to the new expression framework.

mysql> select tidb_version();
+-----------------------------------------------------------------------------------------------+
| tidb_version() |
+-----------------------------------------------------------------------------------------------+
| Git Commit Hash: 6d49c51
UTC Build Time: 2017-07-01 05:52:20 |
+-----------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

Show outdated Hide outdated expression/builtin_info.go
}
type builtinTiDBVersionSig struct {
baseBuiltinFunc

This comment has been minimized.

@zz-jason

zz-jason Jul 3, 2017

Member

currently we are refactoring our expression evaluation framework, it's better to use the new expression evaluation mechanism: replace baseBuiltinFunc with baseStringBuiltinFunc and implements evalString() instead of eval()

@zz-jason

zz-jason Jul 3, 2017

Member

currently we are refactoring our expression evaluation framework, it's better to use the new expression evaluation mechanism: replace baseBuiltinFunc with baseStringBuiltinFunc and implements evalString() instead of eval()

@shenli shenli removed the status/DNM label Jul 15, 2017

@shenli shenli changed the title from [DNM] Add a tidb_version() function to show tidb-server info to Add a tidb_version() function to show tidb-server info Jul 15, 2017

@shenli

This comment has been minimized.

Show comment
Hide comment
Show outdated Hide outdated expression/builtin_info.go
baseStringBuiltinFunc
}
// eval evals a builtinTiDBVersionSig.

This comment has been minimized.

@zz-jason

zz-jason Jul 15, 2017

Member

update comment, change eval to evalString

@zz-jason

zz-jason Jul 15, 2017

Member

update comment, change eval to evalString

@shenli

This comment has been minimized.

Show comment
Hide comment
Member

shenli commented Jul 15, 2017

@zz-jason PTAL

@shenli

This comment has been minimized.

Show comment
Hide comment
Member

shenli commented Jul 17, 2017

@XuHuaiyu PTAL

Show outdated Hide outdated expression/builtin_info.go
if err != nil {
return nil, errors.Trace(err)
}
sig := &builtinTiDBVersionSig{baseStringBuiltinFunc{bf}}

This comment has been minimized.

@XuHuaiyu

XuHuaiyu Jul 17, 2017

Contributor

tp is not used.
set bf.tp.Flen = len(printer.GetTiDBInfo()) here,
and remove line 256 and line 257.

bf.tp.Tp has been set in newBaseBuiltinFuncWithTp.

@XuHuaiyu

XuHuaiyu Jul 17, 2017

Contributor

tp is not used.
set bf.tp.Flen = len(printer.GetTiDBInfo()) here,
and remove line 256 and line 257.

bf.tp.Tp has been set in newBaseBuiltinFuncWithTp.

@shenli

This comment has been minimized.

Show comment
Hide comment
Member

shenli commented Jul 17, 2017

@XuHuaiyu PTAL

@shenli shenli added the status/LGT1 label Jul 17, 2017

@XuHuaiyu

This comment has been minimized.

Show comment
Hide comment
@XuHuaiyu

XuHuaiyu Jul 17, 2017

Contributor

a test in plan/typeinfer_test.go TypeInferType is also needed. @shenli

Contributor

XuHuaiyu commented Jul 17, 2017

a test in plan/typeinfer_test.go TypeInferType is also needed. @shenli

@shenli

This comment has been minimized.

Show comment
Hide comment
Member

shenli commented Jul 17, 2017

@XuHuaiyu PTAL

@XuHuaiyu

This comment has been minimized.

Show comment
Hide comment
@XuHuaiyu

XuHuaiyu Jul 17, 2017

Contributor

LGTM

Contributor

XuHuaiyu commented Jul 17, 2017

LGTM

@shenli shenli merged commit bde940f into master Jul 17, 2017

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

@shenli shenli deleted the shenli/tidb-info branch Jul 17, 2017

dbjoa added a commit to cloud-pi/tidb that referenced this pull request Jul 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment