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

Copr: Fix precision loss while unflatten `Duration` in `codec` #5367

Merged
merged 12 commits into from Sep 5, 2019

Conversation

@iosmanthus
Copy link
Contributor

commented Aug 30, 2019

What have you changed?

While we unflatten a datum, we are taking a risk of losing the precision of Duration because we decode the raw datum without considering the fsp of Duration. I add some tests to cover the issue and fix the bugs.

Bug Reproduction:

mysql root@127.0.0.1:test> create table t (c TIME(2))                                                                                                 
Query OK, 0 rows affected
Time: 0.119s
mysql root@127.0.0.1:test> insert into t values ('12:34:56.666')                                                                                      
Query OK, 1 row affected
Time: 0.037s
mysql root@127.0.0.1:test> select * from t where c < '12:34:57'                                                                                       
+---+
| c |
+---+

What is the type of changes?

Pick one of the following and delete the others:

  • Bugfix (a change which fixes an issue)

How is the PR tested?

cargo test in tikv/components/tidb_query

iosmanthus added 2 commits Aug 30, 2019
Fix bugs of `unflatten`
* Add some tests to cover issue of precision loss in `unflatten`

Signed-off-by: Iosmanthus Teng <myosmanthustree@gmail.com>

@iosmanthus iosmanthus added the C: Copr label Aug 30, 2019

@iosmanthus iosmanthus requested a review from breeswish Aug 30, 2019

@iosmanthus iosmanthus changed the title Fix precision loss while unflatten `Duration` in `codec` Copr:Fix precision loss while unflatten `Duration` in `codec` Aug 30, 2019

@iosmanthus iosmanthus changed the title Copr:Fix precision loss while unflatten `Duration` in `codec` Copr: Fix precision loss while unflatten `Duration` in `codec` Aug 30, 2019

iosmanthus and others added 3 commits Aug 30, 2019
Add missing FieldType for `decode_duration_from_i64`
Signed-off-by: Iosmanthus Teng <myosmanthustree@gmail.com>
@breeswish
Copy link
Member

left a comment

The rest LGTM

iosmanthus added 2 commits Sep 2, 2019
Add `as_accessor` as #5290 demand
Signed-off-by: Iosmanthus Teng <myosmanthustree@gmail.com>
@breeswish

This comment has been minimized.

Copy link
Member

commented Sep 2, 2019

/run-all-tests

@iosmanthus iosmanthus requested review from AndreMouche, lonng and BusyJay Sep 3, 2019

iosmanthus added 3 commits Sep 3, 2019
@breeswish

This comment has been minimized.

Copy link
Member

commented Sep 4, 2019

Please find someone else to give another approval for this PR.

@mapleFU
mapleFU approved these changes Sep 5, 2019
@breeswish

This comment has been minimized.

Copy link
Member

commented Sep 5, 2019

/merge

@sre-bot sre-bot added the S: CanMerge label Sep 5, 2019

@sre-bot

This comment has been minimized.

Copy link
Collaborator

commented Sep 5, 2019

/run-all-tests

@sre-bot sre-bot merged commit 4950eb1 into tikv:master Sep 5, 2019

6 checks passed

DCO All commits are signed off!
Details
idc-jenkins-ci-tikv/integration-common-test Jenkins job succeeded.
Details
idc-jenkins-ci-tikv/integration-compatibility-test Jenkins job succeeded.
Details
idc-jenkins-ci-tikv/integration-cop-push-down-test Jenkins job succeeded.
Details
idc-jenkins-ci-tikv/integration-ddl-test Jenkins job succeeded.
Details
idc-jenkins-ci/test Jenkins job succeeded.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.