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: YEAR, MONTH #4210

Merged
merged 11 commits into from Aug 22, 2017

Conversation

Projects
None yet
3 participants
@zz-jason
Member

zz-jason commented Aug 16, 2017

to #4080

@zz-jason zz-jason referenced this pull request Aug 16, 2017

Closed

rewrite builtin functions #4080

150 of 150 tasks complete
Show outdated Hide outdated expression/builtin_time.go Outdated
@zz-jason

This comment has been minimized.

Show comment
Hide comment
@zz-jason
Member

zz-jason commented Aug 22, 2017

@@ -167,28 +170,31 @@ func (s *testEvaluatorSuite) TestDate(c *C) {
YearWeek interface{}
}{
{nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil},
{"0000-00-00", int64(0), int64(0), nil, int64(0), nil, nil, nil, nil, nil, nil, nil},
{"0000-00-00 00:00:00", nil, nil, nil, int64(0), nil, nil, nil, nil, nil, nil, nil},

This comment has been minimized.

@jackysp

jackysp Aug 22, 2017

Member

Why change this instead of add a test?

@jackysp

jackysp Aug 22, 2017

Member

Why change this instead of add a test?

This comment has been minimized.

@zz-jason

zz-jason Aug 22, 2017

Member

added back.

@zz-jason

zz-jason Aug 22, 2017

Member

added back.

@@ -943,6 +943,46 @@ func (s *testIntegrationSuite) TestTimeBuiltin(c *C) {
result := tk.MustQuery("select makedate(a,a), makedate(b,b), makedate(c,c), makedate(d,d), makedate(e,e), makedate(f,f), makedate(null,null), makedate(a,b) from t")
result.Check(testkit.Rows("2001-01-01 2001-01-01 <nil> <nil> <nil> 2021-01-21 <nil> 2001-01-01"))
// for year
result = tk.MustQuery(`select year("2013-01-09"), year("2013-00-09"), year("000-01-09"), year("1-01-09"), year("20131-01-09"), year(null);`)

This comment has been minimized.

@XuHuaiyu

XuHuaiyu Aug 22, 2017

Contributor

add test for "2013-00-00", "2013-00-00 00:00:00", "0000-00-00 12:12:12", "2017-00-00 12:12:12"
so as month

@XuHuaiyu

XuHuaiyu Aug 22, 2017

Contributor

add test for "2013-00-00", "2013-00-00 00:00:00", "0000-00-00 12:12:12", "2017-00-00 12:12:12"
so as month

@zz-jason

This comment has been minimized.

Show comment
Hide comment
@zz-jason
Member

zz-jason commented Aug 22, 2017

@jackysp PTAL

@jackysp

LGTM

@jackysp jackysp merged commit 9372c6a into master Aug 22, 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

@jackysp jackysp deleted the timefunc_year branch Aug 22, 2017

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

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