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

expression: rewrite builtin function: EXTRACT #4456

Merged
merged 7 commits into from Sep 7, 2017

Conversation

Projects
None yet
3 participants
@XuHuaiyu
Contributor

XuHuaiyu commented Sep 6, 2017

XuHuaiyu added some commits Sep 6, 2017

isDatetimeUnit := true
args[0] = WrapWithCastAsString(args[0], ctx)
if _, isCon := args[0].(*Constant); isCon {
unit, _, err1 := args[0].EvalString(nil, ctx.GetSessionVars().StmtCtx)

This comment has been minimized.

@zz-jason

zz-jason Sep 7, 2017

Member

why not check NULL ?

@zz-jason

zz-jason Sep 7, 2017

Member

why not check NULL ?

This comment has been minimized.

@XuHuaiyu

XuHuaiyu Sep 7, 2017

Contributor
  1. NULL would not happen since the value of the first argument be checked by parser.
  2. getFunction cannot handle NULL, we can only handle NULL in evalXXX, so we ignore NULL here.
@XuHuaiyu

XuHuaiyu Sep 7, 2017

Contributor
  1. NULL would not happen since the value of the first argument be checked by parser.
  2. getFunction cannot handle NULL, we can only handle NULL in evalXXX, so we ignore NULL here.
Show outdated Hide outdated util/types/time.go
Show outdated Hide outdated util/types/time.go

@zz-jason zz-jason referenced this pull request Sep 7, 2017

Closed

rewrite builtin functions #4080

150 of 150 tasks complete
@XuHuaiyu

This comment has been minimized.

Show comment
Hide comment
@XuHuaiyu

XuHuaiyu Sep 7, 2017

Contributor

PTAL @zz-jason

Contributor

XuHuaiyu commented Sep 7, 2017

PTAL @zz-jason

@zz-jason zz-jason changed the title from expression, plan: rewrite builtin func extract to expression: rewrite builtin function: EXTRACT Sep 7, 2017

@coocood

This comment has been minimized.

Show comment
Hide comment
@coocood

coocood Sep 7, 2017

Member

LGTM

Member

coocood commented Sep 7, 2017

LGTM

@zz-jason

LGTM

@zz-jason

This comment has been minimized.

Show comment
Hide comment
@zz-jason

zz-jason Sep 7, 2017

Member

/run-all-test

Member

zz-jason commented Sep 7, 2017

/run-all-test

@zz-jason zz-jason added the status/LGT2 label Sep 7, 2017

@zz-jason zz-jason merged commit f380a74 into master Sep 7, 2017

4 checks passed

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

@zz-jason zz-jason deleted the xhy/extract branch Sep 7, 2017

mccxj added a commit to mccxj/tidb that referenced this pull request Sep 7, 2017

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