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: fixed json type for truncate #13064

Merged
merged 20 commits into from
Dec 4, 2019

Conversation

ekalinin
Copy link
Contributor

@ekalinin ekalinin commented Oct 31, 2019

What problem does this PR solve?

Fixes #13044

What is changed and how it works?

tidb> select truncate(json_array(), 1), truncate("cascasc", -1), truncate("12.3333", -1);
+---------------------------+-------------------------+-------------------------+
| truncate(json_array(), 1) | truncate("cascasc", -1) | truncate("12.3333", -1) |
+---------------------------+-------------------------+-------------------------+
|                         0 |                       0 |                      10 |
+---------------------------+-------------------------+-------------------------+
1 row in set, 1 warning (0.00 sec)

the same output has mysql (v5.7):

| truncate(json_array(), 1) | truncate("cascasc", -1) | truncate("12.34567", -1) |
| ------------------------- | ----------------------- | ------------------------ |
| 0                         | 0                       | 10                       |

View on DB Fiddle

Check List

Tests

  • Integration test

@ekalinin ekalinin requested a review from a team as a code owner October 31, 2019 14:42
@ghost ghost requested review from SunRunAway and wshwsh12 and removed request for a team October 31, 2019 14:42
@sre-bot sre-bot added the contribution This PR is from a community contributor. label Oct 31, 2019
@codecov
Copy link

codecov bot commented Oct 31, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@bb02b70). Click here to learn what that means.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #13064   +/-   ##
===========================================
  Coverage          ?   80.3958%           
===========================================
  Files             ?        479           
  Lines             ?     119480           
  Branches          ?          0           
===========================================
  Hits              ?      96057           
  Misses            ?      15890           
  Partials          ?       7533

Copy link
Contributor

@SunRunAway SunRunAway left a comment

Choose a reason for hiding this comment

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

LGTM

@SunRunAway SunRunAway added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 4, 2019
expression/builtin_math.go Outdated Show resolved Hide resolved
Copy link
Contributor

@wshwsh12 wshwsh12 left a comment

Choose a reason for hiding this comment

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

LGTM
And please fix the CI.

expression/builtin_math.go Show resolved Hide resolved
@wshwsh12 wshwsh12 removed the status/LGT1 Indicates that a PR has LGTM 1. label Dec 4, 2019
@wshwsh12 wshwsh12 added the status/LGT2 Indicates that a PR has LGTM 2. label Dec 4, 2019
@ekalinin
Copy link
Contributor Author

ekalinin commented Dec 4, 2019

/run-all-tests

Copy link
Contributor

@wshwsh12 wshwsh12 left a comment

Choose a reason for hiding this comment

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

LGTM

@wshwsh12 wshwsh12 added the status/can-merge Indicates a PR has been approved by a committer. label Dec 4, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Dec 4, 2019

/run-all-tests

@sre-bot sre-bot merged commit 9d582b6 into pingcap:master Dec 4, 2019
@ekalinin ekalinin deleted the fix-truncate-json branch December 4, 2019 13:40
XiaTianliang pushed a commit to XiaTianliang/tidb that referenced this pull request Dec 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression contribution This PR is from a community contributor. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lost connection when using builtin function
5 participants