{"action":"created","issue":{"url":"https://api.github.com/repos/pingcap/tidb/issues/7405","repository_url":"https://api.github.com/repos/pingcap/tidb","labels_url":"https://api.github.com/repos/pingcap/tidb/issues/7405/labels{/name}","comments_url":"https://api.github.com/repos/pingcap/tidb/issues/7405/comments","events_url":"https://api.github.com/repos/pingcap/tidb/issues/7405/events","html_url":"https://github.com/pingcap/tidb/pull/7405","id":350793496,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4NTUwNTY5","number":7405,"title":"executor: add more information in error message of replace statement","user":{"login":"jackysp","id":4352397,"node_id":"MDQ6VXNlcjQzNTIzOTc=","avatar_url":"https://avatars1.githubusercontent.com/u/4352397?v=4","gravatar_id":"","url":"https://api.github.com/users/jackysp","html_url":"https://github.com/jackysp","followers_url":"https://api.github.com/users/jackysp/followers","following_url":"https://api.github.com/users/jackysp/following{/other_user}","gists_url":"https://api.github.com/users/jackysp/gists{/gist_id}","starred_url":"https://api.github.com/users/jackysp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackysp/subscriptions","organizations_url":"https://api.github.com/users/jackysp/orgs","repos_url":"https://api.github.com/users/jackysp/repos","events_url":"https://api.github.com/users/jackysp/events{/privacy}","received_events_url":"https://api.github.com/users/jackysp/received_events","type":"User","site_admin":false},"labels":[{"id":970807266,"node_id":"MDU6TGFiZWw5NzA4MDcyNjY=","url":"https://api.github.com/repos/pingcap/tidb/labels/component/executor","name":"component/executor","color":"000000","default":false},{"id":914340021,"node_id":"MDU6TGFiZWw5MTQzNDAwMjE=","url":"https://api.github.com/repos/pingcap/tidb/labels/type/2.0%20cherry-pick","name":"type/2.0 cherry-pick","color":"99d0ef","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-15T12:36:10Z","updated_at":"2018-08-21T07:15:26Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/pingcap/tidb/pulls/7405","html_url":"https://github.com/pingcap/tidb/pull/7405","diff_url":"https://github.com/pingcap/tidb/pull/7405.diff","patch_url":"https://github.com/pingcap/tidb/pull/7405.patch"},"body":"<!--\r\nThank you for contributing to TiDB! Please read TiDB's [CONTRIBUTING](https://github.com/pingcap/tidb/blob/master/CONTRIBUTING.md) document **BEFORE** filing this PR.\r\n-->\r\n\r\n### What problem does this PR solve? <!--add issue link with summary if exists-->\r\nAdd more information in error message of replace statement. e.g. number of rows, the index of all rows, string format of error row datum.\r\n\r\n### What is changed and how it works?\r\nUser will get an error message like,\r\n```\r\n[replace] the 2th of total 2 rows, handle 1: [kv:2]Error: key not exist\r\n```\r\nand the error log will look like,\r\n```\r\n2018/08/15 20:26:52.580 write.go:1842: [error] [replace] the 2th of total 2 rows, handle 1: [kv:2]Error: key not exist, row: [{1 0 0 0 1 [] <nil>} {1 0 0 0 1 [] <nil>}]\r\n2018/08/15 20:26:52.580 tidb.go:183: [info] RollbackTxn for ddl/autocommit error.\r\n2018/08/15 20:26:52.581 session.go:753: [warning] con:1 session error:\r\n[kv:2]Error: key not exist\r\n/Users/yusp/work/goprojects/src/github.com/pingcap/tidb/kv/union_store.go:186: \r\n/Users/yusp/work/goprojects/src/github.com/pingcap/tidb/store/tikv/txn.go:90: \r\n/Users/yusp/work/goprojects/src/github.com/pingcap/tidb/session/txn.go:144: \r\n/Users/yusp/work/goprojects/src/github.com/pingcap/tidb/table/tables/tables.go:520: \r\n/Users/yusp/work/goprojects/src/github.com/pingcap/tidb/table/tables/tables.go:577: \r\n/Users/yusp/work/goprojects/src/github.com/pingcap/tidb/executor/write.go:1841: [replace] the 2th of total 2 rows, handle 1\r\n/Users/yusp/work/goprojects/src/github.com/pingcap/tidb/executor/write.go:1893: \r\n/Users/yusp/work/goprojects/src/github.com/pingcap/tidb/executor/adapter.go:268: \r\n/Users/yusp/work/goprojects/src/github.com/pingcap/tidb/session/tidb.go:200: \r\n{\r\n  \"currDBName\": \"test\",\r\n  \"id\": 1,\r\n  \"status\": 2,\r\n  \"strictMode\": true,\r\n  \"user\": null\r\n}\r\n```\r\n\r\n### Check List <!--REMOVE the items that are not applicable-->\r\n\r\nTests <!-- At least one of them must be included. -->\r\n\r\n - Unit test\r\n\r\nPTAL @shenli @coocood "},"comment":{"url":"https://api.github.com/repos/pingcap/tidb/issues/comments/414574251","html_url":"https://github.com/pingcap/tidb/pull/7405#issuecomment-414574251","issue_url":"https://api.github.com/repos/pingcap/tidb/issues/7405","id":414574251,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDU3NDI1MQ==","user":{"login":"coocood","id":891222,"node_id":"MDQ6VXNlcjg5MTIyMg==","avatar_url":"https://avatars0.githubusercontent.com/u/891222?v=4","gravatar_id":"","url":"https://api.github.com/users/coocood","html_url":"https://github.com/coocood","followers_url":"https://api.github.com/users/coocood/followers","following_url":"https://api.github.com/users/coocood/following{/other_user}","gists_url":"https://api.github.com/users/coocood/gists{/gist_id}","starred_url":"https://api.github.com/users/coocood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coocood/subscriptions","organizations_url":"https://api.github.com/users/coocood/orgs","repos_url":"https://api.github.com/users/coocood/repos","events_url":"https://api.github.com/users/coocood/events{/privacy}","received_events_url":"https://api.github.com/users/coocood/received_events","type":"User","site_admin":false},"created_at":"2018-08-21T07:15:26Z","updated_at":"2018-08-21T07:15:26Z","author_association":"MEMBER","body":"LGTM"}}
{"actor":{"display_login":"coocood"}}