-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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 unexpected error msg for cast string to decimal #47267
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #47267 +/- ##
================================================
- Coverage 72.9209% 72.6988% -0.2221%
================================================
Files 1340 1369 +29
Lines 400295 407419 +7124
================================================
+ Hits 291899 296189 +4290
- Misses 89463 92411 +2948
+ Partials 18933 18819 -114
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -2059,3 +2059,15 @@ func TestIssue41986(t *testing.T) { | |||
// shouldn't report they can't find column error and return the right result. | |||
tk.MustQuery("SELECT GROUP_CONCAT(effective_date order by stlmnt_hour DESC) FROM ( SELECT (COALESCE(pct.clearing_time, 0)/3600000) AS stlmnt_hour ,COALESCE(pct.effective_date, '1970-01-01 08:00:00') AS effective_date FROM poi_clearing_time_topic pct ORDER BY pct.effective_date DESC ) a;").Check(testkit.Rows("2023-08-25 00:00:00")) | |||
} | |||
|
|||
func TestCastErrMsg(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better move it to tests/integrationtest
. It will have better performance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: guo-shaoge <shaoge1994@163.com>
[LGTM Timeline notifier]Timeline:
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Defined2014, XuHuaiyu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
What problem does this PR solve?
Issue Number: close #44274
Problem Summary: When you use
ErrTruncated
, you should use it like here. Otherwise the err msg will got%s %d
For cast, should use
ErrTruncatedWrongVal
, just like mysql.What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.