{"action":"created","comment":{"url":"https://api.github.com/repos/tikv/tikv/pulls/comments/218086469","pull_request_review_id":155946233,"id":218086469,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODA4NjQ2OQ==","diff_hunk":"@@ -45,6 +45,61 @@ impl ScalarFunc {\n         }\n     }\n \n+    #[inline]\n+    pub fn oct_int<'a, 'b: 'a>(\n+        &'b self,\n+        ctx: &mut EvalContext,\n+        row: &[Datum],\n+    ) -> Result<Option<Cow<'a, [u8]>>> {\n+        let input = try_opt!(self.children[0].eval_string(ctx, row));\n+        let mut num: u64 = 0;\n+        let mut i: usize = 1;\n+        let mut overflow = false;\n+        let neg = match input[0] {","path":"src/coprocessor/dag/expr/builtin_string.rs","position":14,"original_position":14,"commit_id":"6ba36b5ef91ada4569cb45e2971fc38300ae18e6","original_commit_id":"6ba36b5ef91ada4569cb45e2971fc38300ae18e6","user":{"login":"spongedu","id":4725158,"node_id":"MDQ6VXNlcjQ3MjUxNTg=","avatar_url":"https://avatars0.githubusercontent.com/u/4725158?v=4","gravatar_id":"","url":"https://api.github.com/users/spongedu","html_url":"https://github.com/spongedu","followers_url":"https://api.github.com/users/spongedu/followers","following_url":"https://api.github.com/users/spongedu/following{/other_user}","gists_url":"https://api.github.com/users/spongedu/gists{/gist_id}","starred_url":"https://api.github.com/users/spongedu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spongedu/subscriptions","organizations_url":"https://api.github.com/users/spongedu/orgs","repos_url":"https://api.github.com/users/spongedu/repos","events_url":"https://api.github.com/users/spongedu/events{/privacy}","received_events_url":"https://api.github.com/users/spongedu/received_events","type":"User","site_admin":false},"body":"1. Maybe write the tests just as `builtin bit_count` is better because this is builtin `OctInt`. Current form of tests is more suitable for `OctString`, I think. \r\n2. We'd better check the MySQL source code first. I'm not sure now, as well","created_at":"2018-09-17T14:17:02Z","updated_at":"2018-09-17T14:17:02Z","html_url":"https://github.com/tikv/tikv/pull/3605#discussion_r218086469","pull_request_url":"https://api.github.com/repos/tikv/tikv/pulls/3605","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/tikv/tikv/pulls/comments/218086469"},"html":{"href":"https://github.com/tikv/tikv/pull/3605#discussion_r218086469"},"pull_request":{"href":"https://api.github.com/repos/tikv/tikv/pulls/3605"}},"in_reply_to_id":217938315},"pull_request":{"url":"https://api.github.com/repos/tikv/tikv/pulls/3605","id":215270857,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1MjcwODU3","html_url":"https://github.com/tikv/tikv/pull/3605","diff_url":"https://github.com/tikv/tikv/pull/3605.diff","patch_url":"https://github.com/tikv/tikv/pull/3605.patch","issue_url":"https://api.github.com/repos/tikv/tikv/issues/3605","number":3605,"state":"open","locked":false,"title":"coprocessor/dag/expr: add OctInt","user":{"login":"yjhmelody","id":16250688,"node_id":"MDQ6VXNlcjE2MjUwNjg4","avatar_url":"https://avatars0.githubusercontent.com/u/16250688?v=4","gravatar_id":"","url":"https://api.github.com/users/yjhmelody","html_url":"https://github.com/yjhmelody","followers_url":"https://api.github.com/users/yjhmelody/followers","following_url":"https://api.github.com/users/yjhmelody/following{/other_user}","gists_url":"https://api.github.com/users/yjhmelody/gists{/gist_id}","starred_url":"https://api.github.com/users/yjhmelody/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yjhmelody/subscriptions","organizations_url":"https://api.github.com/users/yjhmelody/orgs","repos_url":"https://api.github.com/users/yjhmelody/repos","events_url":"https://api.github.com/users/yjhmelody/events{/privacy}","received_events_url":"https://api.github.com/users/yjhmelody/received_events","type":"User","site_admin":false},"body":"<!--\r\nThank you for contributing to TiKV! Please read TiKV's [CONTRIBUTING](https://github.com/tikv/tikv/blob/master/CONTRIBUTING.md) document **BEFORE** filing this PR.\r\n-->\r\nSigned-off-by: yjh <yjh465402634@gmail.com>\r\n\r\n## What have you changed? (mandatory)\r\nimplement builtin function: OctInt in coprocessor.\r\n#3275\r\n\r\n## How has this PR been tested? (mandatory)\r\n`make expression`\r\n","created_at":"2018-09-13T12:48:30Z","updated_at":"2018-09-17T14:17:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3d6a9eaa0009599f4b2fc0d6b5709cf70c40bb8e","assignee":null,"assignees":[],"requested_reviewers":[{"login":"breeswish","id":1916485,"node_id":"MDQ6VXNlcjE5MTY0ODU=","avatar_url":"https://avatars3.githubusercontent.com/u/1916485?v=4","gravatar_id":"","url":"https://api.github.com/users/breeswish","html_url":"https://github.com/breeswish","followers_url":"https://api.github.com/users/breeswish/followers","following_url":"https://api.github.com/users/breeswish/following{/other_user}","gists_url":"https://api.github.com/users/breeswish/gists{/gist_id}","starred_url":"https://api.github.com/users/breeswish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/breeswish/subscriptions","organizations_url":"https://api.github.com/users/breeswish/orgs","repos_url":"https://api.github.com/users/breeswish/repos","events_url":"https://api.github.com/users/breeswish/events{/privacy}","received_events_url":"https://api.github.com/users/breeswish/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":526233180,"node_id":"MDU6TGFiZWw1MjYyMzMxODA=","url":"https://api.github.com/repos/tikv/tikv/labels/C:%20Copr","name":"C: Copr","color":"d1fad7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/tikv/tikv/pulls/3605/commits","review_comments_url":"https://api.github.com/repos/tikv/tikv/pulls/3605/comments","review_comment_url":"https://api.github.com/repos/tikv/tikv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tikv/tikv/issues/3605/comments","statuses_url":"https://api.github.com/repos/tikv/tikv/statuses/6ba36b5ef91ada4569cb45e2971fc38300ae18e6","head":{"label":"yjhmelody:master","ref":"master","sha":"6ba36b5ef91ada4569cb45e2971fc38300ae18e6","user":{"login":"yjhmelody","id":16250688,"node_id":"MDQ6VXNlcjE2MjUwNjg4","avatar_url":"https://avatars0.githubusercontent.com/u/16250688?v=4","gravatar_id":"","url":"https://api.github.com/users/yjhmelody","html_url":"https://github.com/yjhmelody","followers_url":"https://api.github.com/users/yjhmelody/followers","following_url":"https://api.github.com/users/yjhmelody/following{/other_user}","gists_url":"https://api.github.com/users/yjhmelody/gists{/gist_id}","starred_url":"https://api.github.com/users/yjhmelody/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yjhmelody/subscriptions","organizations_url":"https://api.github.com/users/yjhmelody/orgs","repos_url":"https://api.github.com/users/yjhmelody/repos","events_url":"https://api.github.com/users/yjhmelody/events{/privacy}","received_events_url":"https://api.github.com/users/yjhmelody/received_events","type":"User","site_admin":false},"repo":{"id":148634982,"node_id":"MDEwOlJlcG9zaXRvcnkxNDg2MzQ5ODI=","name":"tikv","full_name":"yjhmelody/tikv","private":false,"owner":{"login":"yjhmelody","id":16250688,"node_id":"MDQ6VXNlcjE2MjUwNjg4","avatar_url":"https://avatars0.githubusercontent.com/u/16250688?v=4","gravatar_id":"","url":"https://api.github.com/users/yjhmelody","html_url":"https://github.com/yjhmelody","followers_url":"https://api.github.com/users/yjhmelody/followers","following_url":"https://api.github.com/users/yjhmelody/following{/other_user}","gists_url":"https://api.github.com/users/yjhmelody/gists{/gist_id}","starred_url":"https://api.github.com/users/yjhmelody/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yjhmelody/subscriptions","organizations_url":"https://api.github.com/users/yjhmelody/orgs","repos_url":"https://api.github.com/users/yjhmelody/repos","events_url":"https://api.github.com/users/yjhmelody/events{/privacy}","received_events_url":"https://api.github.com/users/yjhmelody/received_events","type":"User","site_admin":false},"html_url":"https://github.com/yjhmelody/tikv","description":"Distributed transactional key-value database, originally created to complement TiDB","fork":true,"url":"https://api.github.com/repos/yjhmelody/tikv","forks_url":"https://api.github.com/repos/yjhmelody/tikv/forks","keys_url":"https://api.github.com/repos/yjhmelody/tikv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yjhmelody/tikv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yjhmelody/tikv/teams","hooks_url":"https://api.github.com/repos/yjhmelody/tikv/hooks","issue_events_url":"https://api.github.com/repos/yjhmelody/tikv/issues/events{/number}","events_url":"https://api.github.com/repos/yjhmelody/tikv/events","assignees_url":"https://api.github.com/repos/yjhmelody/tikv/assignees{/user}","branches_url":"https://api.github.com/repos/yjhmelody/tikv/branches{/branch}","tags_url":"https://api.github.com/repos/yjhmelody/tikv/tags","blobs_url":"https://api.github.com/repos/yjhmelody/tikv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yjhmelody/tikv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yjhmelody/tikv/git/refs{/sha}","trees_url":"https://api.github.com/repos/yjhmelody/tikv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yjhmelody/tikv/statuses/{sha}","languages_url":"https://api.github.com/repos/yjhmelody/tikv/languages","stargazers_url":"https://api.github.com/repos/yjhmelody/tikv/stargazers","contributors_url":"https://api.github.com/repos/yjhmelody/tikv/contributors","subscribers_url":"https://api.github.com/repos/yjhmelody/tikv/subscribers","subscription_url":"https://api.github.com/repos/yjhmelody/tikv/subscription","commits_url":"https://api.github.com/repos/yjhmelody/tikv/commits{/sha}","git_commits_url":"https://api.github.com/repos/yjhmelody/tikv/git/commits{/sha}","comments_url":"https://api.github.com/repos/yjhmelody/tikv/comments{/number}","issue_comment_url":"https://api.github.com/repos/yjhmelody/tikv/issues/comments{/number}","contents_url":"https://api.github.com/repos/yjhmelody/tikv/contents/{+path}","compare_url":"https://api.github.com/repos/yjhmelody/tikv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yjhmelody/tikv/merges","archive_url":"https://api.github.com/repos/yjhmelody/tikv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yjhmelody/tikv/downloads","issues_url":"https://api.github.com/repos/yjhmelody/tikv/issues{/number}","pulls_url":"https://api.github.com/repos/yjhmelody/tikv/pulls{/number}","milestones_url":"https://api.github.com/repos/yjhmelody/tikv/milestones{/number}","notifications_url":"https://api.github.com/repos/yjhmelody/tikv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yjhmelody/tikv/labels{/name}","releases_url":"https://api.github.com/repos/yjhmelody/tikv/releases{/id}","deployments_url":"https://api.github.com/repos/yjhmelody/tikv/deployments","created_at":"2018-09-13T12:34:28Z","updated_at":"2018-09-16T06:16:58Z","pushed_at":"2018-09-16T06:16:55Z","git_url":"git://github.com/yjhmelody/tikv.git","ssh_url":"git@github.com:yjhmelody/tikv.git","clone_url":"https://github.com/yjhmelody/tikv.git","svn_url":"https://github.com/yjhmelody/tikv","homepage":"https://tikv.org","size":16599,"stargazers_count":0,"watchers_count":0,"language":"Rust","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":"tikv:master","ref":"master","sha":"7fc4d1d6df89dc9903e243f8f6eab9484113e0de","user":{"login":"tikv","id":41004122,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDA0MTIy","avatar_url":"https://avatars2.githubusercontent.com/u/41004122?v=4","gravatar_id":"","url":"https://api.github.com/users/tikv","html_url":"https://github.com/tikv","followers_url":"https://api.github.com/users/tikv/followers","following_url":"https://api.github.com/users/tikv/following{/other_user}","gists_url":"https://api.github.com/users/tikv/gists{/gist_id}","starred_url":"https://api.github.com/users/tikv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tikv/subscriptions","organizations_url":"https://api.github.com/users/tikv/orgs","repos_url":"https://api.github.com/users/tikv/repos","events_url":"https://api.github.com/users/tikv/events{/privacy}","received_events_url":"https://api.github.com/users/tikv/received_events","type":"Organization","site_admin":false},"repo":{"id":48833910,"node_id":"MDEwOlJlcG9zaXRvcnk0ODgzMzkxMA==","name":"tikv","full_name":"tikv/tikv","private":false,"owner":{"login":"tikv","id":41004122,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDA0MTIy","avatar_url":"https://avatars2.githubusercontent.com/u/41004122?v=4","gravatar_id":"","url":"https://api.github.com/users/tikv","html_url":"https://github.com/tikv","followers_url":"https://api.github.com/users/tikv/followers","following_url":"https://api.github.com/users/tikv/following{/other_user}","gists_url":"https://api.github.com/users/tikv/gists{/gist_id}","starred_url":"https://api.github.com/users/tikv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tikv/subscriptions","organizations_url":"https://api.github.com/users/tikv/orgs","repos_url":"https://api.github.com/users/tikv/repos","events_url":"https://api.github.com/users/tikv/events{/privacy}","received_events_url":"https://api.github.com/users/tikv/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/tikv/tikv","description":"Distributed transactional key-value database, originally created to complement TiDB","fork":false,"url":"https://api.github.com/repos/tikv/tikv","forks_url":"https://api.github.com/repos/tikv/tikv/forks","keys_url":"https://api.github.com/repos/tikv/tikv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tikv/tikv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tikv/tikv/teams","hooks_url":"https://api.github.com/repos/tikv/tikv/hooks","issue_events_url":"https://api.github.com/repos/tikv/tikv/issues/events{/number}","events_url":"https://api.github.com/repos/tikv/tikv/events","assignees_url":"https://api.github.com/repos/tikv/tikv/assignees{/user}","branches_url":"https://api.github.com/repos/tikv/tikv/branches{/branch}","tags_url":"https://api.github.com/repos/tikv/tikv/tags","blobs_url":"https://api.github.com/repos/tikv/tikv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tikv/tikv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tikv/tikv/git/refs{/sha}","trees_url":"https://api.github.com/repos/tikv/tikv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tikv/tikv/statuses/{sha}","languages_url":"https://api.github.com/repos/tikv/tikv/languages","stargazers_url":"https://api.github.com/repos/tikv/tikv/stargazers","contributors_url":"https://api.github.com/repos/tikv/tikv/contributors","subscribers_url":"https://api.github.com/repos/tikv/tikv/subscribers","subscription_url":"https://api.github.com/repos/tikv/tikv/subscription","commits_url":"https://api.github.com/repos/tikv/tikv/commits{/sha}","git_commits_url":"https://api.github.com/repos/tikv/tikv/git/commits{/sha}","comments_url":"https://api.github.com/repos/tikv/tikv/comments{/number}","issue_comment_url":"https://api.github.com/repos/tikv/tikv/issues/comments{/number}","contents_url":"https://api.github.com/repos/tikv/tikv/contents/{+path}","compare_url":"https://api.github.com/repos/tikv/tikv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tikv/tikv/merges","archive_url":"https://api.github.com/repos/tikv/tikv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tikv/tikv/downloads","issues_url":"https://api.github.com/repos/tikv/tikv/issues{/number}","pulls_url":"https://api.github.com/repos/tikv/tikv/pulls{/number}","milestones_url":"https://api.github.com/repos/tikv/tikv/milestones{/number}","notifications_url":"https://api.github.com/repos/tikv/tikv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tikv/tikv/labels{/name}","releases_url":"https://api.github.com/repos/tikv/tikv/releases{/id}","deployments_url":"https://api.github.com/repos/tikv/tikv/deployments","created_at":"2015-12-31T04:51:32Z","updated_at":"2018-09-17T06:43:38Z","pushed_at":"2018-09-17T10:01:11Z","git_url":"git://github.com/tikv/tikv.git","ssh_url":"git@github.com:tikv/tikv.git","clone_url":"https://github.com/tikv/tikv.git","svn_url":"https://github.com/tikv/tikv","homepage":"https://tikv.org","size":16556,"stargazers_count":3711,"watchers_count":3711,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":505,"mirror_url":null,"archived":false,"open_issues_count":253,"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":505,"open_issues":253,"watchers":3711,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tikv/tikv/pulls/3605"},"html":{"href":"https://github.com/tikv/tikv/pull/3605"},"issue":{"href":"https://api.github.com/repos/tikv/tikv/issues/3605"},"comments":{"href":"https://api.github.com/repos/tikv/tikv/issues/3605/comments"},"review_comments":{"href":"https://api.github.com/repos/tikv/tikv/pulls/3605/comments"},"review_comment":{"href":"https://api.github.com/repos/tikv/tikv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tikv/tikv/pulls/3605/commits"},"statuses":{"href":"https://api.github.com/repos/tikv/tikv/statuses/6ba36b5ef91ada4569cb45e2971fc38300ae18e6"}},"author_association":"NONE"}}
{"actor":{"display_login":"spongedu"}}