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, parser: refine parser of localtime and localtimestamp #4503

Merged
merged 4 commits into from Sep 12, 2017

Conversation

Projects
None yet
4 participants
@XuHuaiyu
Contributor

XuHuaiyu commented Sep 12, 2017

localtime/ localtime()/ localtimestamp/ localtimestmp()
are all the synonyms of NOW().

PTAL @zz-jason @breeswish

@@ -1504,6 +1504,10 @@ func (s *testIntegrationSuite) TestTimeBuiltin(c *C) {
// for extract
result = tk.MustQuery(`select extract(day from '800:12:12'), extract(hour from '800:12:12'), extract(month from 20170101), extract(day_second from '2017-01-01 12:12:12')`)
result.Check(testkit.Rows("12 800 1 1121212"))
// for localtime, localtimestamp
result = tk.MustQuery(`select localtime() = now(), localtime = now(), localtimestamp() = now(), localtimestamp = now()`)

This comment has been minimized.

@zz-jason

zz-jason Sep 12, 2017

Member
select current_timestamp = now();

should also return 1, maybe we can add it into this test

@zz-jason

zz-jason Sep 12, 2017

Member
select current_timestamp = now();

should also return 1, maybe we can add it into this test

This comment has been minimized.

@winkyao

winkyao Sep 12, 2017

Member

+1

@winkyao
@@ -1504,6 +1504,10 @@ func (s *testIntegrationSuite) TestTimeBuiltin(c *C) {
// for extract
result = tk.MustQuery(`select extract(day from '800:12:12'), extract(hour from '800:12:12'), extract(month from 20170101), extract(day_second from '2017-01-01 12:12:12')`)
result.Check(testkit.Rows("12 800 1 1121212"))
// for localtime, localtimestamp
result = tk.MustQuery(`select localtime() = now(), localtime = now(), localtimestamp() = now(), localtimestamp = now()`)

This comment has been minimized.

@winkyao

winkyao Sep 12, 2017

Member

+1

@winkyao
@XuHuaiyu

This comment has been minimized.

Show comment
Hide comment
@XuHuaiyu
Contributor

XuHuaiyu commented Sep 12, 2017

@winkyao winkyao added the status/LGT1 label Sep 12, 2017

@zz-jason

LGTM

@zz-jason

This comment has been minimized.

Show comment
Hide comment
@zz-jason

zz-jason Sep 12, 2017

Member

/run-all-test

Member

zz-jason commented Sep 12, 2017

/run-all-test

@hanfei1991 hanfei1991 merged commit 262260a into master Sep 12, 2017

10 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
jenkins-ci-tidb/common-test Jenkins job succeeded.
Details
jenkins-ci-tidb/integration-common-test Jenkins job succeeded.
Details
jenkins-ci-tidb/integration-ddl-test Jenkins job succeeded.
Details
jenkins-ci-tidb/mybatis-test Jenkins job succeeded.
Details
jenkins-ci-tidb/sqllogic-test Jenkins job succeeded.
Details
jenkins-ci-tidb/unit-test Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@hanfei1991 hanfei1991 deleted the xhy/localtime branch Sep 12, 2017

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