{"action":"opened","number":333,"pull_request":{"url":"https://api.github.com/repos/go-sql-driver/mysql/pulls/333","id":34121223,"html_url":"https://github.com/go-sql-driver/mysql/pull/333","diff_url":"https://github.com/go-sql-driver/mysql/pull/333.diff","patch_url":"https://github.com/go-sql-driver/mysql/pull/333.patch","issue_url":"https://api.github.com/repos/go-sql-driver/mysql/issues/333","number":333,"state":"open","locked":false,"title":"Add initial support for connection attributes.","user":{"login":"dveeden","id":1272980,"avatar_url":"https://avatars.githubusercontent.com/u/1272980?v=3","gravatar_id":"","url":"https://api.github.com/users/dveeden","html_url":"https://github.com/dveeden","followers_url":"https://api.github.com/users/dveeden/followers","following_url":"https://api.github.com/users/dveeden/following{/other_user}","gists_url":"https://api.github.com/users/dveeden/gists{/gist_id}","starred_url":"https://api.github.com/users/dveeden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dveeden/subscriptions","organizations_url":"https://api.github.com/users/dveeden/orgs","repos_url":"https://api.github.com/users/dveeden/repos","events_url":"https://api.github.com/users/dveeden/events{/privacy}","received_events_url":"https://api.github.com/users/dveeden/received_events","type":"User","site_admin":false},"body":"This sets attribute _client_name with the value \"Go MySQL Driver\"\r\n\r\nHere processlist_id=58 is the connection from the Go MySQL Driver.\r\n```\r\nmysql> select * from performance_schema.session_connect_attrs; show processlist;\r\n+----------------+-----------------+------------------+------------------+\r\n| PROCESSLIST_ID | ATTR_NAME       | ATTR_VALUE       | ORDINAL_POSITION |\r\n+----------------+-----------------+------------------+------------------+\r\n|              3 | _os             | Linux            |                0 |\r\n|              3 | _client_name    | libmysql         |                1 |\r\n|              3 | _pid            | 3891             |                2 |\r\n|              3 | _client_version | 5.7.7-rc         |                3 |\r\n|              3 | _platform       | x86_64           |                4 |\r\n|              3 | program_name    | Slave I/O Thread |                5 |\r\n|              3 | channel_name    | NULL             |                6 |\r\n|              6 | _os             | Linux            |                0 |\r\n|              6 | _client_name    | libmysql         |                1 |\r\n|              6 | _pid            | 3618             |                2 |\r\n|              6 | _client_version | 5.7.7-rc         |                3 |\r\n|              6 | _platform       | x86_64           |                4 |\r\n|              6 | program_name    | Slave I/O Thread |                5 |\r\n|              6 | channel_name    | testc1           |                6 |\r\n|             58 | _client_name    | Go MySQL Driver  |                0 |\r\n|             59 | _os             | Linux            |                0 |\r\n|             59 | _client_name    | libmysql         |                1 |\r\n|             59 | _pid            | 14429            |                2 |\r\n|             59 | _client_version | 5.7.7-rc         |                3 |\r\n|             59 | _platform       | x86_64           |                4 |\r\n|             59 | program_name    | mysql            |                5 |\r\n+----------------+-----------------+------------------+------------------+\r\n21 rows in set (0.00 sec)\r\n```\r\n\r\nThis could later be extended to:\r\n* Send more information \r\n * _os\r\n * _client_version\r\n * _pid\r\n * _platform\r\n * program_name\r\n* Send custom information\r\n * e.g. Key/Value pairs\r\n\r\nThe attributes send by the C library use _<name> and the application using the C library usually sets program_name to $0\r\n\r\n","created_at":"2015-04-26T10:47:56Z","updated_at":"2015-04-26T10:47:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c3509bbbf1d408e3985ffb1228055b26a70390b1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/go-sql-driver/mysql/pulls/333/commits","review_comments_url":"https://api.github.com/repos/go-sql-driver/mysql/pulls/333/comments","review_comment_url":"https://api.github.com/repos/go-sql-driver/mysql/pulls/comments{/number}","comments_url":"https://api.github.com/repos/go-sql-driver/mysql/issues/333/comments","statuses_url":"https://api.github.com/repos/go-sql-driver/mysql/statuses/5a5393a4cc52274880f3643e3925e7cf790eb436","head":{"label":"dveeden:master","ref":"master","sha":"5a5393a4cc52274880f3643e3925e7cf790eb436","user":{"login":"dveeden","id":1272980,"avatar_url":"https://avatars.githubusercontent.com/u/1272980?v=3","gravatar_id":"","url":"https://api.github.com/users/dveeden","html_url":"https://github.com/dveeden","followers_url":"https://api.github.com/users/dveeden/followers","following_url":"https://api.github.com/users/dveeden/following{/other_user}","gists_url":"https://api.github.com/users/dveeden/gists{/gist_id}","starred_url":"https://api.github.com/users/dveeden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dveeden/subscriptions","organizations_url":"https://api.github.com/users/dveeden/orgs","repos_url":"https://api.github.com/users/dveeden/repos","events_url":"https://api.github.com/users/dveeden/events{/privacy}","received_events_url":"https://api.github.com/users/dveeden/received_events","type":"User","site_admin":false},"repo":{"id":34607394,"name":"mysql","full_name":"dveeden/mysql","owner":{"login":"dveeden","id":1272980,"avatar_url":"https://avatars.githubusercontent.com/u/1272980?v=3","gravatar_id":"","url":"https://api.github.com/users/dveeden","html_url":"https://github.com/dveeden","followers_url":"https://api.github.com/users/dveeden/followers","following_url":"https://api.github.com/users/dveeden/following{/other_user}","gists_url":"https://api.github.com/users/dveeden/gists{/gist_id}","starred_url":"https://api.github.com/users/dveeden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dveeden/subscriptions","organizations_url":"https://api.github.com/users/dveeden/orgs","repos_url":"https://api.github.com/users/dveeden/repos","events_url":"https://api.github.com/users/dveeden/events{/privacy}","received_events_url":"https://api.github.com/users/dveeden/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dveeden/mysql","description":"Go-MySQL-Driver is a lightweight and fast MySQL-Driver for Go's (golang) database/sql package","fork":true,"url":"https://api.github.com/repos/dveeden/mysql","forks_url":"https://api.github.com/repos/dveeden/mysql/forks","keys_url":"https://api.github.com/repos/dveeden/mysql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dveeden/mysql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dveeden/mysql/teams","hooks_url":"https://api.github.com/repos/dveeden/mysql/hooks","issue_events_url":"https://api.github.com/repos/dveeden/mysql/issues/events{/number}","events_url":"https://api.github.com/repos/dveeden/mysql/events","assignees_url":"https://api.github.com/repos/dveeden/mysql/assignees{/user}","branches_url":"https://api.github.com/repos/dveeden/mysql/branches{/branch}","tags_url":"https://api.github.com/repos/dveeden/mysql/tags","blobs_url":"https://api.github.com/repos/dveeden/mysql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dveeden/mysql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dveeden/mysql/git/refs{/sha}","trees_url":"https://api.github.com/repos/dveeden/mysql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dveeden/mysql/statuses/{sha}","languages_url":"https://api.github.com/repos/dveeden/mysql/languages","stargazers_url":"https://api.github.com/repos/dveeden/mysql/stargazers","contributors_url":"https://api.github.com/repos/dveeden/mysql/contributors","subscribers_url":"https://api.github.com/repos/dveeden/mysql/subscribers","subscription_url":"https://api.github.com/repos/dveeden/mysql/subscription","commits_url":"https://api.github.com/repos/dveeden/mysql/commits{/sha}","git_commits_url":"https://api.github.com/repos/dveeden/mysql/git/commits{/sha}","comments_url":"https://api.github.com/repos/dveeden/mysql/comments{/number}","issue_comment_url":"https://api.github.com/repos/dveeden/mysql/issues/comments{/number}","contents_url":"https://api.github.com/repos/dveeden/mysql/contents/{+path}","compare_url":"https://api.github.com/repos/dveeden/mysql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dveeden/mysql/merges","archive_url":"https://api.github.com/repos/dveeden/mysql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dveeden/mysql/downloads","issues_url":"https://api.github.com/repos/dveeden/mysql/issues{/number}","pulls_url":"https://api.github.com/repos/dveeden/mysql/pulls{/number}","milestones_url":"https://api.github.com/repos/dveeden/mysql/milestones{/number}","notifications_url":"https://api.github.com/repos/dveeden/mysql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dveeden/mysql/labels{/name}","releases_url":"https://api.github.com/repos/dveeden/mysql/releases{/id}","created_at":"2015-04-26T10:37:52Z","updated_at":"2015-04-26T10:38:58Z","pushed_at":"2015-04-26T10:38:56Z","git_url":"git://github.com/dveeden/mysql.git","ssh_url":"git@github.com:dveeden/mysql.git","clone_url":"https://github.com/dveeden/mysql.git","svn_url":"https://github.com/dveeden/mysql","homepage":"http://godoc.org/github.com/go-sql-driver/mysql","size":2710,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"go-sql-driver:master","ref":"master","sha":"a197e5d40516f2e9f74dcee085a5f2d4604e94df","user":{"login":"go-sql-driver","id":3002971,"avatar_url":"https://avatars.githubusercontent.com/u/3002971?v=3","gravatar_id":"","url":"https://api.github.com/users/go-sql-driver","html_url":"https://github.com/go-sql-driver","followers_url":"https://api.github.com/users/go-sql-driver/followers","following_url":"https://api.github.com/users/go-sql-driver/following{/other_user}","gists_url":"https://api.github.com/users/go-sql-driver/gists{/gist_id}","starred_url":"https://api.github.com/users/go-sql-driver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/go-sql-driver/subscriptions","organizations_url":"https://api.github.com/users/go-sql-driver/orgs","repos_url":"https://api.github.com/users/go-sql-driver/repos","events_url":"https://api.github.com/users/go-sql-driver/events{/privacy}","received_events_url":"https://api.github.com/users/go-sql-driver/received_events","type":"Organization","site_admin":false},"repo":{"id":7083242,"name":"mysql","full_name":"go-sql-driver/mysql","owner":{"login":"go-sql-driver","id":3002971,"avatar_url":"https://avatars.githubusercontent.com/u/3002971?v=3","gravatar_id":"","url":"https://api.github.com/users/go-sql-driver","html_url":"https://github.com/go-sql-driver","followers_url":"https://api.github.com/users/go-sql-driver/followers","following_url":"https://api.github.com/users/go-sql-driver/following{/other_user}","gists_url":"https://api.github.com/users/go-sql-driver/gists{/gist_id}","starred_url":"https://api.github.com/users/go-sql-driver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/go-sql-driver/subscriptions","organizations_url":"https://api.github.com/users/go-sql-driver/orgs","repos_url":"https://api.github.com/users/go-sql-driver/repos","events_url":"https://api.github.com/users/go-sql-driver/events{/privacy}","received_events_url":"https://api.github.com/users/go-sql-driver/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/go-sql-driver/mysql","description":"Go-MySQL-Driver is a lightweight and fast MySQL-Driver for Go's (golang) database/sql package","fork":false,"url":"https://api.github.com/repos/go-sql-driver/mysql","forks_url":"https://api.github.com/repos/go-sql-driver/mysql/forks","keys_url":"https://api.github.com/repos/go-sql-driver/mysql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/go-sql-driver/mysql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/go-sql-driver/mysql/teams","hooks_url":"https://api.github.com/repos/go-sql-driver/mysql/hooks","issue_events_url":"https://api.github.com/repos/go-sql-driver/mysql/issues/events{/number}","events_url":"https://api.github.com/repos/go-sql-driver/mysql/events","assignees_url":"https://api.github.com/repos/go-sql-driver/mysql/assignees{/user}","branches_url":"https://api.github.com/repos/go-sql-driver/mysql/branches{/branch}","tags_url":"https://api.github.com/repos/go-sql-driver/mysql/tags","blobs_url":"https://api.github.com/repos/go-sql-driver/mysql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/go-sql-driver/mysql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/go-sql-driver/mysql/git/refs{/sha}","trees_url":"https://api.github.com/repos/go-sql-driver/mysql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/go-sql-driver/mysql/statuses/{sha}","languages_url":"https://api.github.com/repos/go-sql-driver/mysql/languages","stargazers_url":"https://api.github.com/repos/go-sql-driver/mysql/stargazers","contributors_url":"https://api.github.com/repos/go-sql-driver/mysql/contributors","subscribers_url":"https://api.github.com/repos/go-sql-driver/mysql/subscribers","subscription_url":"https://api.github.com/repos/go-sql-driver/mysql/subscription","commits_url":"https://api.github.com/repos/go-sql-driver/mysql/commits{/sha}","git_commits_url":"https://api.github.com/repos/go-sql-driver/mysql/git/commits{/sha}","comments_url":"https://api.github.com/repos/go-sql-driver/mysql/comments{/number}","issue_comment_url":"https://api.github.com/repos/go-sql-driver/mysql/issues/comments{/number}","contents_url":"https://api.github.com/repos/go-sql-driver/mysql/contents/{+path}","compare_url":"https://api.github.com/repos/go-sql-driver/mysql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/go-sql-driver/mysql/merges","archive_url":"https://api.github.com/repos/go-sql-driver/mysql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/go-sql-driver/mysql/downloads","issues_url":"https://api.github.com/repos/go-sql-driver/mysql/issues{/number}","pulls_url":"https://api.github.com/repos/go-sql-driver/mysql/pulls{/number}","milestones_url":"https://api.github.com/repos/go-sql-driver/mysql/milestones{/number}","notifications_url":"https://api.github.com/repos/go-sql-driver/mysql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/go-sql-driver/mysql/labels{/name}","releases_url":"https://api.github.com/repos/go-sql-driver/mysql/releases{/id}","created_at":"2012-12-09T20:33:55Z","updated_at":"2015-04-26T08:08:21Z","pushed_at":"2015-04-26T10:47:57Z","git_url":"git://github.com/go-sql-driver/mysql.git","ssh_url":"git@github.com:go-sql-driver/mysql.git","clone_url":"https://github.com/go-sql-driver/mysql.git","svn_url":"https://github.com/go-sql-driver/mysql","homepage":"http://godoc.org/github.com/go-sql-driver/mysql","size":2710,"stargazers_count":1373,"watchers_count":1373,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":314,"mirror_url":null,"open_issues_count":22,"forks":314,"open_issues":22,"watchers":1373,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/go-sql-driver/mysql/pulls/333"},"html":{"href":"https://github.com/go-sql-driver/mysql/pull/333"},"issue":{"href":"https://api.github.com/repos/go-sql-driver/mysql/issues/333"},"comments":{"href":"https://api.github.com/repos/go-sql-driver/mysql/issues/333/comments"},"review_comments":{"href":"https://api.github.com/repos/go-sql-driver/mysql/pulls/333/comments"},"review_comment":{"href":"https://api.github.com/repos/go-sql-driver/mysql/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/go-sql-driver/mysql/pulls/333/commits"},"statuses":{"href":"https://api.github.com/repos/go-sql-driver/mysql/statuses/5a5393a4cc52274880f3643e3925e7cf790eb436"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":25,"deletions":0,"changed_files":2}}