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
Merged

expression: fix missing microsecond for timestamp #7418

merged 3 commits into from
Aug 17, 2018

Conversation

imtbkcat
Copy link

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

@imtbkcat Please add some UT

@imtbkcat
Copy link
Author

PTAL @zz-jason

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@shenli
Copy link
Member

shenli commented Aug 17, 2018

/run-all-tests

Copy link
Contributor

@zhexuany zhexuany left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

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

LGTM

@zimulala zimulala added the status/LGT2 Indicates that a PR has LGTM 2. label Aug 17, 2018
@coocood coocood merged commit 8f1b494 into pingcap:master Aug 17, 2018
@imtbkcat imtbkcat deleted the fix7334 branch September 25, 2018 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug. type/compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants