{"action":"created","comment":{"url":"https://api.github.com/repos/src-d/go-mysql-server/pulls/comments/216231554","pull_request_review_id":153664108,"id":216231554,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNjIzMTU1NA==","diff_hunk":"@@ -0,0 +1,174 @@\n+package analyzer\n+\n+import (\n+\t\"fmt\"\n+\t\"hash/crc32\"\n+\t\"io\"\n+\n+\t\"gopkg.in/src-d/go-mysql-server.v0/sql\"\n+\t\"gopkg.in/src-d/go-mysql-server.v0/sql/plan\"\n+)\n+\n+func trackProcess(ctx *sql.Context, a *Analyzer, n sql.Node) (sql.Node, error) {\n+\tif !n.Resolved() {\n+\t\treturn n, nil\n+\t}\n+\n+\tif _, ok := n.(*queryProcess); ok {\n+\t\treturn n, nil\n+\t}\n+\n+\tvar query string\n+\tif x, ok := ctx.Value(sql.QueryKey).(string); ok {\n+\t\tquery = x\n+\t}\n+\n+\tvar typ = sql.QueryProcess\n+\tif _, ok := n.(*plan.CreateIndex); ok {\n+\t\ttyp = sql.CreateIndexProcess\n+\t}\n+\n+\tprocessList := a.Catalog.ProcessList\n+\tpid := processList.AddProcess(ctx, typ, query)\n+\n+\tvar seen = make(map[string]struct{})\n+\twrapTable := func(name string, t sql.Table) (sql.Table, error) {\n+\t\tif _, ok := seen[name]; ok {\n+\t\t\treturn t, nil\n+\t\t}\n+\n+\t\tvar total int64 = -1\n+\t\tif counter, ok := t.(sql.PartitionCounter); ok {\n+\t\t\tcount, err := counter.PartitionCount(ctx)\n+\t\t\tif err != nil {\n+\t\t\t\treturn nil, err\n+\t\t\t}\n+\t\t\ttotal = count\n+\t\t}\n+\t\tprocessList.AddProgressItem(pid, name, total)\n+\n+\t\tseen[name] = struct{}{}\n+\t\treturn &processTable{t, func() {\n+\t\t\tprocessList.UpdateProgress(pid, name, 1)\n+\t\t}}, nil\n+\t}\n+\n+\tn, err := n.TransformUp(func(n sql.Node) (sql.Node, error) {\n+\t\tswitch n := n.(type) {\n+\t\tcase *plan.ResolvedTable:\n+\t\t\tif _, ok := n.Table.(*processTable); ok {\n+\t\t\t\treturn n, nil\n+\t\t\t}\n+\n+\t\t\tt, err := wrapTable(n.Name(), n.Table)\n+\t\t\tif err != nil {\n+\t\t\t\treturn nil, err\n+\t\t\t}\n+\n+\t\t\treturn plan.NewResolvedTable(n.Name(), t), nil\n+\t\tcase sql.Table:","path":"sql/analyzer/process.go","position":69,"original_position":69,"commit_id":"af666ed08d205e8f3b1c63da8c12fc9d730b26d0","original_commit_id":"af666ed08d205e8f3b1c63da8c12fc9d730b26d0","user":{"login":"ajnavarro","id":1196465,"node_id":"MDQ6VXNlcjExOTY0NjU=","avatar_url":"https://avatars3.githubusercontent.com/u/1196465?v=4","gravatar_id":"","url":"https://api.github.com/users/ajnavarro","html_url":"https://github.com/ajnavarro","followers_url":"https://api.github.com/users/ajnavarro/followers","following_url":"https://api.github.com/users/ajnavarro/following{/other_user}","gists_url":"https://api.github.com/users/ajnavarro/gists{/gist_id}","starred_url":"https://api.github.com/users/ajnavarro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajnavarro/subscriptions","organizations_url":"https://api.github.com/users/ajnavarro/orgs","repos_url":"https://api.github.com/users/ajnavarro/repos","events_url":"https://api.github.com/users/ajnavarro/events{/privacy}","received_events_url":"https://api.github.com/users/ajnavarro/received_events","type":"User","site_admin":false},"body":"So, if I understood correctly, maybe the easiest solution is to move the table name to the sql.Table interface, and apply the rule just to `sql.Table`s, right?\r\n","created_at":"2018-09-10T08:12:05Z","updated_at":"2018-09-10T08:12:05Z","html_url":"https://github.com/src-d/go-mysql-server/pull/352#discussion_r216231554","pull_request_url":"https://api.github.com/repos/src-d/go-mysql-server/pulls/352","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/src-d/go-mysql-server/pulls/comments/216231554"},"html":{"href":"https://github.com/src-d/go-mysql-server/pull/352#discussion_r216231554"},"pull_request":{"href":"https://api.github.com/repos/src-d/go-mysql-server/pulls/352"}},"in_reply_to_id":216227719},"pull_request":{"url":"https://api.github.com/repos/src-d/go-mysql-server/pulls/352","id":213649221,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzNjQ5MjIx","html_url":"https://github.com/src-d/go-mysql-server/pull/352","diff_url":"https://github.com/src-d/go-mysql-server/pull/352.diff","patch_url":"https://github.com/src-d/go-mysql-server/pull/352.patch","issue_url":"https://api.github.com/repos/src-d/go-mysql-server/issues/352","number":352,"state":"open","locked":false,"title":"*: implement show full processlist","user":{"login":"erizocosmico","id":1312023,"node_id":"MDQ6VXNlcjEzMTIwMjM=","avatar_url":"https://avatars1.githubusercontent.com/u/1312023?v=4","gravatar_id":"","url":"https://api.github.com/users/erizocosmico","html_url":"https://github.com/erizocosmico","followers_url":"https://api.github.com/users/erizocosmico/followers","following_url":"https://api.github.com/users/erizocosmico/following{/other_user}","gists_url":"https://api.github.com/users/erizocosmico/gists{/gist_id}","starred_url":"https://api.github.com/users/erizocosmico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erizocosmico/subscriptions","organizations_url":"https://api.github.com/users/erizocosmico/orgs","repos_url":"https://api.github.com/users/erizocosmico/repos","events_url":"https://api.github.com/users/erizocosmico/events{/privacy}","received_events_url":"https://api.github.com/users/erizocosmico/received_events","type":"User","site_admin":false},"body":"Closes #348","created_at":"2018-09-06T14:57:28Z","updated_at":"2018-09-10T08:12:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8bcd429b52f0b90b2a68e6b065aebf8b3a4e1388","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/src-d/go-mysql-server/pulls/352/commits","review_comments_url":"https://api.github.com/repos/src-d/go-mysql-server/pulls/352/comments","review_comment_url":"https://api.github.com/repos/src-d/go-mysql-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/src-d/go-mysql-server/issues/352/comments","statuses_url":"https://api.github.com/repos/src-d/go-mysql-server/statuses/af666ed08d205e8f3b1c63da8c12fc9d730b26d0","head":{"label":"erizocosmico:feature/stats","ref":"feature/stats","sha":"af666ed08d205e8f3b1c63da8c12fc9d730b26d0","user":{"login":"erizocosmico","id":1312023,"node_id":"MDQ6VXNlcjEzMTIwMjM=","avatar_url":"https://avatars1.githubusercontent.com/u/1312023?v=4","gravatar_id":"","url":"https://api.github.com/users/erizocosmico","html_url":"https://github.com/erizocosmico","followers_url":"https://api.github.com/users/erizocosmico/followers","following_url":"https://api.github.com/users/erizocosmico/following{/other_user}","gists_url":"https://api.github.com/users/erizocosmico/gists{/gist_id}","starred_url":"https://api.github.com/users/erizocosmico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erizocosmico/subscriptions","organizations_url":"https://api.github.com/users/erizocosmico/orgs","repos_url":"https://api.github.com/users/erizocosmico/repos","events_url":"https://api.github.com/users/erizocosmico/events{/privacy}","received_events_url":"https://api.github.com/users/erizocosmico/received_events","type":"User","site_admin":false},"repo":{"id":121627235,"node_id":"MDEwOlJlcG9zaXRvcnkxMjE2MjcyMzU=","name":"go-mysql-server","full_name":"erizocosmico/go-mysql-server","owner":{"login":"erizocosmico","id":1312023,"node_id":"MDQ6VXNlcjEzMTIwMjM=","avatar_url":"https://avatars1.githubusercontent.com/u/1312023?v=4","gravatar_id":"","url":"https://api.github.com/users/erizocosmico","html_url":"https://github.com/erizocosmico","followers_url":"https://api.github.com/users/erizocosmico/followers","following_url":"https://api.github.com/users/erizocosmico/following{/other_user}","gists_url":"https://api.github.com/users/erizocosmico/gists{/gist_id}","starred_url":"https://api.github.com/users/erizocosmico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erizocosmico/subscriptions","organizations_url":"https://api.github.com/users/erizocosmico/orgs","repos_url":"https://api.github.com/users/erizocosmico/repos","events_url":"https://api.github.com/users/erizocosmico/events{/privacy}","received_events_url":"https://api.github.com/users/erizocosmico/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/erizocosmico/go-mysql-server","description":null,"fork":true,"url":"https://api.github.com/repos/erizocosmico/go-mysql-server","forks_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/forks","keys_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/teams","hooks_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/hooks","issue_events_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/issues/events{/number}","events_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/events","assignees_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/assignees{/user}","branches_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/branches{/branch}","tags_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/tags","blobs_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/statuses/{sha}","languages_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/languages","stargazers_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/stargazers","contributors_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/contributors","subscribers_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/subscribers","subscription_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/subscription","commits_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/contents/{+path}","compare_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/merges","archive_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/downloads","issues_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/issues{/number}","pulls_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/pulls{/number}","milestones_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/milestones{/number}","notifications_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/labels{/name}","releases_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/releases{/id}","deployments_url":"https://api.github.com/repos/erizocosmico/go-mysql-server/deployments","created_at":"2018-02-15T12:28:11Z","updated_at":"2018-06-29T09:45:36Z","pushed_at":"2018-09-10T07:57:27Z","git_url":"git://github.com/erizocosmico/go-mysql-server.git","ssh_url":"git@github.com:erizocosmico/go-mysql-server.git","clone_url":"https://github.com/erizocosmico/go-mysql-server.git","svn_url":"https://github.com/erizocosmico/go-mysql-server","homepage":null,"size":1377,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"src-d:master","ref":"master","sha":"034975aca688494d4578236a70dec08949356062","user":{"login":"src-d","id":15128793,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MTI4Nzkz","avatar_url":"https://avatars2.githubusercontent.com/u/15128793?v=4","gravatar_id":"","url":"https://api.github.com/users/src-d","html_url":"https://github.com/src-d","followers_url":"https://api.github.com/users/src-d/followers","following_url":"https://api.github.com/users/src-d/following{/other_user}","gists_url":"https://api.github.com/users/src-d/gists{/gist_id}","starred_url":"https://api.github.com/users/src-d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/src-d/subscriptions","organizations_url":"https://api.github.com/users/src-d/orgs","repos_url":"https://api.github.com/users/src-d/repos","events_url":"https://api.github.com/users/src-d/events{/privacy}","received_events_url":"https://api.github.com/users/src-d/received_events","type":"Organization","site_admin":false},"repo":{"id":121319560,"node_id":"MDEwOlJlcG9zaXRvcnkxMjEzMTk1NjA=","name":"go-mysql-server","full_name":"src-d/go-mysql-server","owner":{"login":"src-d","id":15128793,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MTI4Nzkz","avatar_url":"https://avatars2.githubusercontent.com/u/15128793?v=4","gravatar_id":"","url":"https://api.github.com/users/src-d","html_url":"https://github.com/src-d","followers_url":"https://api.github.com/users/src-d/followers","following_url":"https://api.github.com/users/src-d/following{/other_user}","gists_url":"https://api.github.com/users/src-d/gists{/gist_id}","starred_url":"https://api.github.com/users/src-d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/src-d/subscriptions","organizations_url":"https://api.github.com/users/src-d/orgs","repos_url":"https://api.github.com/users/src-d/repos","events_url":"https://api.github.com/users/src-d/events{/privacy}","received_events_url":"https://api.github.com/users/src-d/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/src-d/go-mysql-server","description":"An extensible MySQL server implementation in Go.","fork":false,"url":"https://api.github.com/repos/src-d/go-mysql-server","forks_url":"https://api.github.com/repos/src-d/go-mysql-server/forks","keys_url":"https://api.github.com/repos/src-d/go-mysql-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/src-d/go-mysql-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/src-d/go-mysql-server/teams","hooks_url":"https://api.github.com/repos/src-d/go-mysql-server/hooks","issue_events_url":"https://api.github.com/repos/src-d/go-mysql-server/issues/events{/number}","events_url":"https://api.github.com/repos/src-d/go-mysql-server/events","assignees_url":"https://api.github.com/repos/src-d/go-mysql-server/assignees{/user}","branches_url":"https://api.github.com/repos/src-d/go-mysql-server/branches{/branch}","tags_url":"https://api.github.com/repos/src-d/go-mysql-server/tags","blobs_url":"https://api.github.com/repos/src-d/go-mysql-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/src-d/go-mysql-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/src-d/go-mysql-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/src-d/go-mysql-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/src-d/go-mysql-server/statuses/{sha}","languages_url":"https://api.github.com/repos/src-d/go-mysql-server/languages","stargazers_url":"https://api.github.com/repos/src-d/go-mysql-server/stargazers","contributors_url":"https://api.github.com/repos/src-d/go-mysql-server/contributors","subscribers_url":"https://api.github.com/repos/src-d/go-mysql-server/subscribers","subscription_url":"https://api.github.com/repos/src-d/go-mysql-server/subscription","commits_url":"https://api.github.com/repos/src-d/go-mysql-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/src-d/go-mysql-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/src-d/go-mysql-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/src-d/go-mysql-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/src-d/go-mysql-server/contents/{+path}","compare_url":"https://api.github.com/repos/src-d/go-mysql-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/src-d/go-mysql-server/merges","archive_url":"https://api.github.com/repos/src-d/go-mysql-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/src-d/go-mysql-server/downloads","issues_url":"https://api.github.com/repos/src-d/go-mysql-server/issues{/number}","pulls_url":"https://api.github.com/repos/src-d/go-mysql-server/pulls{/number}","milestones_url":"https://api.github.com/repos/src-d/go-mysql-server/milestones{/number}","notifications_url":"https://api.github.com/repos/src-d/go-mysql-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/src-d/go-mysql-server/labels{/name}","releases_url":"https://api.github.com/repos/src-d/go-mysql-server/releases{/id}","deployments_url":"https://api.github.com/repos/src-d/go-mysql-server/deployments","created_at":"2018-02-13T00:24:19Z","updated_at":"2018-09-10T07:52:51Z","pushed_at":"2018-09-10T07:52:49Z","git_url":"git://github.com/src-d/go-mysql-server.git","ssh_url":"git@github.com:src-d/go-mysql-server.git","clone_url":"https://github.com/src-d/go-mysql-server.git","svn_url":"https://github.com/src-d/go-mysql-server","homepage":"","size":1321,"stargazers_count":87,"watchers_count":87,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":15,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":15,"open_issues":21,"watchers":87,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/src-d/go-mysql-server/pulls/352"},"html":{"href":"https://github.com/src-d/go-mysql-server/pull/352"},"issue":{"href":"https://api.github.com/repos/src-d/go-mysql-server/issues/352"},"comments":{"href":"https://api.github.com/repos/src-d/go-mysql-server/issues/352/comments"},"review_comments":{"href":"https://api.github.com/repos/src-d/go-mysql-server/pulls/352/comments"},"review_comment":{"href":"https://api.github.com/repos/src-d/go-mysql-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/src-d/go-mysql-server/pulls/352/commits"},"statuses":{"href":"https://api.github.com/repos/src-d/go-mysql-server/statuses/af666ed08d205e8f3b1c63da8c12fc9d730b26d0"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ajnavarro"}}