{"action":"opened","issue":{"url":"https://api.github.com/repos/pingcap/tidb/issues/6184","repository_url":"https://api.github.com/repos/pingcap/tidb","labels_url":"https://api.github.com/repos/pingcap/tidb/issues/6184/labels{/name}","comments_url":"https://api.github.com/repos/pingcap/tidb/issues/6184/comments","events_url":"https://api.github.com/repos/pingcap/tidb/issues/6184/events","html_url":"https://github.com/pingcap/tidb/issues/6184","id":309691709,"number":6184,"title":"cast_decimal_as_int: append truncate_error when meet overflow_error","user":{"login":"AndreMouche","id":1085697,"avatar_url":"https://avatars1.githubusercontent.com/u/1085697?v=4","gravatar_id":"","url":"https://api.github.com/users/AndreMouche","html_url":"https://github.com/AndreMouche","followers_url":"https://api.github.com/users/AndreMouche/followers","following_url":"https://api.github.com/users/AndreMouche/following{/other_user}","gists_url":"https://api.github.com/users/AndreMouche/gists{/gist_id}","starred_url":"https://api.github.com/users/AndreMouche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndreMouche/subscriptions","organizations_url":"https://api.github.com/users/AndreMouche/orgs","repos_url":"https://api.github.com/users/AndreMouche/repos","events_url":"https://api.github.com/users/AndreMouche/events{/privacy}","received_events_url":"https://api.github.com/users/AndreMouche/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-29T09:54:41Z","updated_at":"2018-03-29T09:54:41Z","closed_at":null,"author_association":"MEMBER","body":"It makes me confused that  it appends truncate error when meet overflow on https://github.com/pingcap/tidb/blob/master/expression/builtin_cast.go#L761\r\n\r\n```\r\n\tif types.ErrOverflow.Equal(err) {\r\n\t\twarnErr := types.ErrTruncatedWrongVal.GenByArgs(\"DECIMAL\", val)\r\n\t\terr = b.ctx.GetSessionVars().StmtCtx.HandleOverflow(err, warnErr)\r\n\t}\r\n```\r\nMeanwhile, should we process `ErrTruncate` too? "}}
{"actor":{"display_login":"AndreMouche"}}