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

planner, expression: support builtin function `NAME_CONST` #9261

Merged
merged 13 commits into from Feb 19, 2019

Conversation

@spongedu
Copy link
Contributor

commented Feb 10, 2019

What problem does this PR solve?

Support builtin function NAME_CONST, part as issue #8439

What is changed and how it works?

  1. implement NAME_CONST in expression/builtin_miscellaneous.go.
  2. rewrite the result column name, as is described in doc: When used to produce a result set column, NAME_CONST() causes the column to have the given name .
  3. the return value of NAME_CONST is actually a const, so I add an extra constant-folding rule for it.
  4. add related tests.

Check List

Tests

  • Unit test

Code changes

Side effects

Related changes

@codecov-io

This comment has been minimized.

Copy link

commented Feb 10, 2019

Codecov Report

Merging #9261 into master will decrease coverage by 0.01%.
The diff coverage is 41.34%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9261      +/-   ##
==========================================
- Coverage   67.14%   67.13%   -0.02%     
==========================================
  Files         372      372              
  Lines       77656    77747      +91     
==========================================
+ Hits        52146    52193      +47     
- Misses      20844    20886      +42     
- Partials     4666     4668       +2
Impacted Files Coverage Δ
planner/core/preprocess.go 86.63% <10%> (-2.03%) ⬇️
planner/core/logical_plan_builder.go 74.14% <37.5%> (-0.41%) ⬇️
expression/builtin_miscellaneous.go 64.73% <47.14%> (-2.64%) ⬇️
expression/schema.go 93.75% <0%> (-0.79%) ⬇️
util/filesort/filesort.go 76.48% <0%> (+0.94%) ⬆️
store/tikv/lock_resolver.go 42.65% <0%> (+0.94%) ⬆️
ddl/delete_range.go 75.13% <0%> (+1.58%) ⬆️
ddl/session_pool.go 93.1% <0%> (+10.34%) ⬆️

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 7c0a9a7...e018d98. Read the comment docs.

spongedu added some commits Feb 10, 2019

@zz-jason zz-jason requested review from qw4990 and eurekaka Feb 11, 2019

Show resolved Hide resolved planner/core/logical_plan_builder.go
Show resolved Hide resolved planner/core/logical_plan_builder.go Outdated
Show resolved Hide resolved planner/core/logical_plan_builder.go
Show resolved Hide resolved planner/core/logical_plan_builder.go
Show resolved Hide resolved planner/core/logical_plan_builder.go
Show resolved Hide resolved expression/constant_fold.go Outdated

spongedu added some commits Feb 11, 2019

@zz-jason

This comment has been minimized.

Copy link
Member

commented Feb 15, 2019

LGTM

@spongedu

This comment has been minimized.

Copy link
Contributor Author

commented Feb 15, 2019

@eurekaka PTAL

@eurekaka
Copy link
Contributor

left a comment

LGTM

@eurekaka

This comment has been minimized.

Copy link
Contributor

commented Feb 18, 2019

/run-all-tests

@spongedu

This comment has been minimized.

Copy link
Contributor Author

commented Feb 19, 2019

@zz-jason @qw4990 PTAL :)

@zz-jason

This comment has been minimized.

Copy link
Member

commented Feb 19, 2019

/run-common-test
/run-integration-common-test

@zz-jason zz-jason merged commit ed7bb00 into pingcap:master Feb 19, 2019

7 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
idc-jenkins-ci-tidb/common-test job succeeded
Details
idc-jenkins-ci-tidb/integration-common-test 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

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