{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/3912","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/3912/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/3912/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/3912/events","html_url":"https://github.com/cockroachdb/cockroach/pull/3912","id":127237287,"number":3912,"title":"sql: allow user priority to be set via SQL","user":{"login":"yaojingguo","id":516386,"avatar_url":"https://avatars.githubusercontent.com/u/516386?v=3","gravatar_id":"","url":"https://api.github.com/users/yaojingguo","html_url":"https://github.com/yaojingguo","followers_url":"https://api.github.com/users/yaojingguo/followers","following_url":"https://api.github.com/users/yaojingguo/following{/other_user}","gists_url":"https://api.github.com/users/yaojingguo/gists{/gist_id}","starred_url":"https://api.github.com/users/yaojingguo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaojingguo/subscriptions","organizations_url":"https://api.github.com/users/yaojingguo/orgs","repos_url":"https://api.github.com/users/yaojingguo/repos","events_url":"https://api.github.com/users/yaojingguo/events{/privacy}","received_events_url":"https://api.github.com/users/yaojingguo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-18T14:30:29Z","updated_at":"2016-01-19T08:01:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/3912","html_url":"https://github.com/cockroachdb/cockroach/pull/3912","diff_url":"https://github.com/cockroachdb/cockroach/pull/3912.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/3912.patch"},"body":"Fixes #2555\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/cockroachdb/cockroach/3912)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/172769577","html_url":"https://github.com/cockroachdb/cockroach/pull/3912#issuecomment-172769577","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/3912","id":172769577,"user":{"login":"yaojingguo","id":516386,"avatar_url":"https://avatars.githubusercontent.com/u/516386?v=3","gravatar_id":"","url":"https://api.github.com/users/yaojingguo","html_url":"https://github.com/yaojingguo","followers_url":"https://api.github.com/users/yaojingguo/followers","following_url":"https://api.github.com/users/yaojingguo/following{/other_user}","gists_url":"https://api.github.com/users/yaojingguo/gists{/gist_id}","starred_url":"https://api.github.com/users/yaojingguo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaojingguo/subscriptions","organizations_url":"https://api.github.com/users/yaojingguo/orgs","repos_url":"https://api.github.com/users/yaojingguo/repos","events_url":"https://api.github.com/users/yaojingguo/events{/privacy}","received_events_url":"https://api.github.com/users/yaojingguo/received_events","type":"User","site_admin":false},"created_at":"2016-01-19T08:01:11Z","updated_at":"2016-01-19T08:01:11Z","body":"Thanks for the helpful code review.\n\n---\n\nReview status: 0 of 15 files reviewed at latest revision, 6 unresolved discussions, some commit checks failed.\n\n---\n\n*[roachpb/api.go, line 27 \\[r2\\]](https://reviewable.io:443/reviews/cockroachdb/cockroach/3912#-K8LFfk7K0DyErPdwbwQ:-K8NoVnsnLJgbTdX4nap:-876328392) ([raw file](https://github.com/cockroachdb/cockroach/blob/997a4e33e8b60718eb031eaefe13450517306a45/roachpb/api.go#L27)):*\nThis type is only used to provide the `UserPriority.String` function.  `UserPriority.String` is used by `v.rows = append(v.rows, []parser.Datum{parser.DString((roachpb.UserPriority(p.txn.UserPriority)).String())})\n` in `sql/planner.Show`. I have tried to use type `UserPriority` in `roachpb/api.proto` with the following code:\n\n```\n\toptional double user_priority = 4 [(gogoproto.nullable) = false,\n\t   (gogoproto.customname) = \"UserPriority\", (gogoproto.casttype) = \"UserPriority\"];\n```\n\nBut when I ran `make build`, I got the following error:\n\n```\nroachpb/api.pb.go:3091: cannot use m.UserPriority (type UserPriority) as type float64 in argument to math.Float64bits\n```\n\nIt seems that `gogoproto.casttype` does not support `double`. So `UserPriority` is used in the current way. Any suggestion on this?\n\n---\n\n*[roachpb/api.go, line 34 \\[r2\\]](https://reviewable.io:443/reviews/cockroachdb/cockroach/3912#-K8LD8QE-niVPVd4DyX-:-K8NmLLYc9ufhXKoUUZR:676635175) ([raw file](https://github.com/cockroachdb/cockroach/blob/997a4e33e8b60718eb031eaefe13450517306a45/roachpb/api.go#L34)):*\nDone\n\n---\n\n*[sql/parser/set.go, line 56 \\[r2\\]](https://reviewable.io:443/reviews/cockroachdb/cockroach/3912#-K8LF4nhWgPfVnbaChtj:-K8NlP8mdAJzWuY65_sS:-499146009) ([raw file](https://github.com/cockroachdb/cockroach/blob/997a4e33e8b60718eb031eaefe13450517306a45/sql/parser/set.go#L56)):*\nDone.\n\n---\n\n*[sql/parser/sql.y, line 1464 \\[r1\\]](https://reviewable.io:443/reviews/cockroachdb/cockroach/3912#-K8KTyN2_sMI5GdQi82D:-K8NPRXRvY8kFFecz0AS:-9142296) ([raw file](https://github.com/cockroachdb/cockroach/blob/fe345989c4b9d588c9494d61f0867afd11dcd87c/sql/parser/sql.y#L1464)):*\nYes, my careless mistake.\n\n---\n\n*[sql/parser/sql.y, line 907 \\[r2\\]](https://reviewable.io:443/reviews/cockroachdb/cockroach/3912#-K8LDad071otUooi6Ev9:-K8NmcRx-buTquCdmQMn:407185734) ([raw file](https://github.com/cockroachdb/cockroach/blob/997a4e33e8b60718eb031eaefe13450517306a45/sql/parser/sql.y#L907)):*\nYes. My careless mistake.\n\n---\n\n*[sql/parser/txn.go, line 84 \\[r2\\]](https://reviewable.io:443/reviews/cockroachdb/cockroach/3912#-K8LEFX3y5utAmmsbonr:-K8NQ64uUCT2rX1-TVlh:-499146009) ([raw file](https://github.com/cockroachdb/cockroach/blob/997a4e33e8b60718eb031eaefe13450517306a45/sql/parser/txn.go#L84)):*\nDone.\n\n---\n\n\n*Comments from the [review on Reviewable.io](https://reviewable.io:443/reviews/cockroachdb/cockroach/3912#-:-K8NoFAFuueVsrFsj_Rk:-979389921)*\n<!-- Sent from Reviewable.io -->\n"}}