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

expression: fix missing microsecond for timestamp #7418

Merged
merged 3 commits into from Aug 17, 2018

Conversation

@imtbkcat
Copy link
Contributor

commented Aug 16, 2018

What problem does this PR solve?

Fix #7334 to make JDBC test happy.

What is changed and how it works?

Microsecond missed in add function because date.Fsp become 0 when we use now() and don't set date.Fsp to 6. I add some code to set date.Fsp = 6 if added with microsecond.

Before:

mysql> select now() - interval 1 microsecond;
+--------------------------------+
| now() - interval 1 microsecond |
+--------------------------------+
| 2018-08-16 20:05:19            |
+--------------------------------+

After:

mysql> select now() - interval 1 microsecond;
+--------------------------------+
| now() - interval 1 microsecond |
+--------------------------------+
| 2018-08-16 20:21:01.999999     |
+--------------------------------+

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

Side effects
no

Related changes

@zz-jason

This comment has been minimized.

Copy link
Member

commented Aug 16, 2018

@imtbkcat Please add some UT

imtbkcat added 2 commits Aug 16, 2018
@imtbkcat

This comment has been minimized.

Copy link
Contributor Author

commented Aug 17, 2018

PTAL @zz-jason

Copy link
Member

left a comment

LGTM

@shenli

This comment has been minimized.

Copy link
Member

commented Aug 17, 2018

/run-all-tests

Copy link
Member

left a comment

LGTM

Copy link
Member

left a comment

LGTM

@coocood coocood merged commit 8f1b494 into pingcap:master Aug 17, 2018
4 checks passed
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
@imtbkcat imtbkcat deleted the imtbkcat:fix7334 branch Sep 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.