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

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
Copy link

codecov-io 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.

@morgo morgo added contribution This PR is from a community contributor. component/expression sig/planner SIG: Planner labels Feb 10, 2019
@zz-jason zz-jason requested review from qw4990 and eurekaka February 11, 2019 02:57
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 Show resolved Hide resolved
@zz-jason
Copy link
Member

LGTM

@spongedu
Copy link
Contributor Author

@eurekaka PTAL

Copy link
Contributor

@eurekaka eurekaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eurekaka eurekaka added the status/LGT2 Indicates that a PR has LGTM 2. label Feb 18, 2019
@eurekaka
Copy link
Contributor

/run-all-tests

@spongedu
Copy link
Contributor Author

@zz-jason @qw4990 PTAL :)

@zz-jason
Copy link
Member

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

@zz-jason zz-jason merged commit ed7bb00 into pingcap:master Feb 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression contribution This PR is from a community contributor. sig/planner SIG: Planner status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants