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

types: convert EOF error to ErrTruncate when parse duration #11865

Merged
merged 4 commits into from
Aug 26, 2019

Conversation

wjhuang2016
Copy link
Member

What problem does this PR solve?

fix #10308

What is changed and how it works?

convert EOF error to ErrTruncate

Check List

Tests

  • Integration test

Code changes

Side effects

Related changes

  • Need to cherry-pick to the release branch

@codecov
Copy link

codecov bot commented Aug 26, 2019

Codecov Report

Merging #11865 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #11865   +/-   ##
===========================================
  Coverage   82.0162%   82.0162%           
===========================================
  Files           438        438           
  Lines        100585     100585           
===========================================
  Hits          82496      82496           
  Misses        12491      12491           
  Partials       5598       5598

@wjhuang2016 wjhuang2016 added the type/bugfix This PR fixes a bug. label Aug 26, 2019
Copy link
Contributor

@winkyao winkyao left a comment

Choose a reason for hiding this comment

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

LGTM

iosmanthus
iosmanthus previously approved these changes Aug 26, 2019

// fix issue 10308
result = tk.MustQuery("select time(\"- -\");")
result.Check(testkit.Rows("00:00:00"))
Copy link
Member

Choose a reason for hiding this comment

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

would mysql through a warning?

Copy link
Member Author

Choose a reason for hiding this comment

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

would mysql through a warning?

Both MySQL and TiDB through a warning:

mysql> show warnings;
+---------+------+---------------------------------------+
| Level   | Code | Message                               |
+---------+------+---------------------------------------+
| Warning | 1292 | Truncated incorrect time value: '- -' |
+---------+------+---------------------------------------+
1 row in set (0.00 sec)

Copy link
Member

Choose a reason for hiding this comment

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

Got it. Could you also test the warning message?

Copy link
Member Author

Choose a reason for hiding this comment

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

Got it. Could you also test the warning message?

Done

@CLAassistant
Copy link

CLAassistant commented Aug 26, 2019

CLA assistant check
All committers have signed the CLA.

@wjhuang2016 wjhuang2016 merged commit 46f1dc1 into pingcap:master Aug 26, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Aug 27, 2019

cherry pick to release-2.1 failed

@sre-bot
Copy link
Contributor

sre-bot commented Aug 27, 2019

cherry pick to release-3.0 in PR #11893

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression status/LGT1 Indicates that a PR has LGTM 1. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lost connection to tidb-server when query a wrong format TIME
6 participants