{"action":"created","issue":{"url":"https://api.github.com/repos/pingcap/tidb/issues/7987","repository_url":"https://api.github.com/repos/pingcap/tidb","labels_url":"https://api.github.com/repos/pingcap/tidb/issues/7987/labels{/name}","comments_url":"https://api.github.com/repos/pingcap/tidb/issues/7987/comments","events_url":"https://api.github.com/repos/pingcap/tidb/issues/7987/events","html_url":"https://github.com/pingcap/tidb/pull/7987","id":372435479,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0NjE3NjI2","number":7987,"title":"server: add log for binary execute 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":1095620003,"node_id":"MDU6TGFiZWwxMDk1NjIwMDAz","url":"https://api.github.com/repos/pingcap/tidb/labels/component/server","name":"component/server","color":"e0854c","default":false},{"id":564574080,"node_id":"MDU6TGFiZWw1NjQ1NzQwODA=","url":"https://api.github.com/repos/pingcap/tidb/labels/status/LGT1","name":"status/LGT1","color":"d4c5f9","default":false},{"id":256872088,"node_id":"MDU6TGFiZWwyNTY4NzIwODg=","url":"https://api.github.com/repos/pingcap/tidb/labels/type/enhancement","name":"type/enhancement","color":"84b6eb","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-10-22T08:34:40Z","updated_at":"2018-10-23T03:55:39Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/pingcap/tidb/pulls/7987","html_url":"https://github.com/pingcap/tidb/pull/7987","diff_url":"https://github.com/pingcap/tidb/pull/7987.diff","patch_url":"https://github.com/pingcap/tidb/pull/7987.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\nThe dispatch error will print the packet data when meets some errors, e.g.\r\n```\r\n2018/10/22 15:45:15.528 conn.go:488: [warning] con:1 dispatch error:\r\nid:1, addr:127.0.0.1:56631 status:2, collation:utf8_general_ci, user:root\r\n\"\\x01\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x01\\x01\\x06\\x00\"\r\n[table:1048]Column 'i' cannot be null\r\n```\r\nIt is not readable.\r\n\r\n### What is changed and how it works?\r\nAdd additional messages for binary execute statement to make the user easy to know the executing SQL and its parameters.\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 - Manual test (add detailed scripts or steps below)\r\nRun the following function though binary APIs.\r\n```go\r\nfunc errMsg(db *sql.DB) {\r\n\tvar err error\r\n\t_, err = db.Exec(\"drop table if exists t\")\r\n\tif err != nil {\r\n\t\tfmt.Println(err)\r\n\t}\r\n\t_, err = db.Exec(\"create table t (i int not null)\")\r\n\tif err != nil {\r\n\t\tfmt.Println(err)\r\n\t}\r\n\t_, err = db.Exec(\"insert into t values (?)\", nil)\r\n\tif err != nil {\r\n\t\tfmt.Println(err)\r\n\t}\r\n}\r\n```\r\nit will add the addtional info, e.g.\r\n```\r\ninsert into t values (?) [arguments: <nil>]\r\n```\r\n\r\nCode changes\r\n\r\n - Has exported function/method change\r\n\r\nSide effects\r\n\r\n - Increased code complexity\r\n\r\nPTAL @lysu @tiancaiamao "},"comment":{"url":"https://api.github.com/repos/pingcap/tidb/issues/comments/432081578","html_url":"https://github.com/pingcap/tidb/pull/7987#issuecomment-432081578","issue_url":"https://api.github.com/repos/pingcap/tidb/issues/7987","id":432081578,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjA4MTU3OA==","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},"created_at":"2018-10-23T03:55:39Z","updated_at":"2018-10-23T03:55:39Z","author_association":"MEMBER","body":"/run-all-tests"}}
{"actor":{"display_login":"jackysp"}}