{"action":"created","comment":{"url":"https://api.github.com/repos/pingcap/tidb/pulls/comments/58217946","id":58217946,"diff_hunk":"@@ -390,6 +390,16 @@ func builtinCurrentTime(args []types.Datum, _ context.Context) (d types.Datum, e\n \treturn convertToDuration(d, fsp)\n }\n \n+// See https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_utc-date\n+func builtinUTCDate(args []types.Datum, _ context.Context) (d types.Datum, err error) {\n+\tyear, month, day := time.Now().Date()\n+\tt := mysql.Time{\n+\t\tTime: time.Date(year, month, day, 0, 0, 0, 0, time.Local),","path":"evaluator/builtin_time.go","position":8,"original_position":8,"commit_id":"440446b5b7fc99589fb68bc56306413bfecb6fd7","original_commit_id":"440446b5b7fc99589fb68bc56306413bfecb6fd7","user":{"login":"overvenus","id":2150711,"avatar_url":"https://avatars.githubusercontent.com/u/2150711?v=3","gravatar_id":"","url":"https://api.github.com/users/overvenus","html_url":"https://github.com/overvenus","followers_url":"https://api.github.com/users/overvenus/followers","following_url":"https://api.github.com/users/overvenus/following{/other_user}","gists_url":"https://api.github.com/users/overvenus/gists{/gist_id}","starred_url":"https://api.github.com/users/overvenus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/overvenus/subscriptions","organizations_url":"https://api.github.com/users/overvenus/orgs","repos_url":"https://api.github.com/users/overvenus/repos","events_url":"https://api.github.com/users/overvenus/events{/privacy}","received_events_url":"https://api.github.com/users/overvenus/received_events","type":"User","site_admin":false},"body":"@shenli It does not work.\r\n\r\ntime.UTC:\r\n```\r\nmysql> select utc_date+1;\r\n+----------------+\r\n| utc_date+1     |\r\n+----------------+\r\n| 20160401000001 |\r\n+----------------+\r\n1 row in set (0.00 sec)\r\n```\r\n\r\nAnd please take a look **current_date**:\r\n\r\n**TiDB**:\r\n```\r\nmysql> select utc_date+1, current_date+1;\r\n+----------------+----------------+\r\n| utc_date+1     | current_date+1 |\r\n+----------------+----------------+\r\n| 20160401000001 | 20160401000001 |\r\n+----------------+----------------+\r\n1 row in set (0.00 sec)\r\n```\r\n\r\n**MySQL**:\r\n\r\n```\r\nmysql> select utc_date+1, current_date+1;\r\n+------------+----------------+\r\n| utc_date+1 | current_date+1 |\r\n+------------+----------------+\r\n|   20160402 |       20160402 |\r\n+------------+----------------+\r\n1 row in set (0.00 sec)\r\n```","created_at":"2016-04-01T14:59:34Z","updated_at":"2016-04-01T14:59:34Z","html_url":"https://github.com/pingcap/tidb/pull/1045#discussion_r58217946","pull_request_url":"https://api.github.com/repos/pingcap/tidb/pulls/1045","_links":{"self":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/comments/58217946"},"html":{"href":"https://github.com/pingcap/tidb/pull/1045#discussion_r58217946"},"pull_request":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/1045"}}},"pull_request":{"url":"https://api.github.com/repos/pingcap/tidb/pulls/1045","id":64950499,"html_url":"https://github.com/pingcap/tidb/pull/1045","diff_url":"https://github.com/pingcap/tidb/pull/1045.diff","patch_url":"https://github.com/pingcap/tidb/pull/1045.patch","issue_url":"https://api.github.com/repos/pingcap/tidb/issues/1045","number":1045,"state":"open","locked":false,"title":"evaluator, parser: support UTC_DATE()","user":{"login":"overvenus","id":2150711,"avatar_url":"https://avatars.githubusercontent.com/u/2150711?v=3","gravatar_id":"","url":"https://api.github.com/users/overvenus","html_url":"https://github.com/overvenus","followers_url":"https://api.github.com/users/overvenus/followers","following_url":"https://api.github.com/users/overvenus/following{/other_user}","gists_url":"https://api.github.com/users/overvenus/gists{/gist_id}","starred_url":"https://api.github.com/users/overvenus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/overvenus/subscriptions","organizations_url":"https://api.github.com/users/overvenus/orgs","repos_url":"https://api.github.com/users/overvenus/repos","events_url":"https://api.github.com/users/overvenus/events{/privacy}","received_events_url":"https://api.github.com/users/overvenus/received_events","type":"User","site_admin":false},"body":"see issue: #236.","created_at":"2016-04-01T14:12:39Z","updated_at":"2016-04-01T14:59:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"beae01415dc6cee346925696efe1bd2f5be33788","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pingcap/tidb/pulls/1045/commits","review_comments_url":"https://api.github.com/repos/pingcap/tidb/pulls/1045/comments","review_comment_url":"https://api.github.com/repos/pingcap/tidb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pingcap/tidb/issues/1045/comments","statuses_url":"https://api.github.com/repos/pingcap/tidb/statuses/440446b5b7fc99589fb68bc56306413bfecb6fd7","head":{"label":"overvenus:builtin-time-utc","ref":"builtin-time-utc","sha":"440446b5b7fc99589fb68bc56306413bfecb6fd7","user":{"login":"overvenus","id":2150711,"avatar_url":"https://avatars.githubusercontent.com/u/2150711?v=3","gravatar_id":"","url":"https://api.github.com/users/overvenus","html_url":"https://github.com/overvenus","followers_url":"https://api.github.com/users/overvenus/followers","following_url":"https://api.github.com/users/overvenus/following{/other_user}","gists_url":"https://api.github.com/users/overvenus/gists{/gist_id}","starred_url":"https://api.github.com/users/overvenus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/overvenus/subscriptions","organizations_url":"https://api.github.com/users/overvenus/orgs","repos_url":"https://api.github.com/users/overvenus/repos","events_url":"https://api.github.com/users/overvenus/events{/privacy}","received_events_url":"https://api.github.com/users/overvenus/received_events","type":"User","site_admin":false},"repo":{"id":55234133,"name":"tidb","full_name":"overvenus/tidb","owner":{"login":"overvenus","id":2150711,"avatar_url":"https://avatars.githubusercontent.com/u/2150711?v=3","gravatar_id":"","url":"https://api.github.com/users/overvenus","html_url":"https://github.com/overvenus","followers_url":"https://api.github.com/users/overvenus/followers","following_url":"https://api.github.com/users/overvenus/following{/other_user}","gists_url":"https://api.github.com/users/overvenus/gists{/gist_id}","starred_url":"https://api.github.com/users/overvenus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/overvenus/subscriptions","organizations_url":"https://api.github.com/users/overvenus/orgs","repos_url":"https://api.github.com/users/overvenus/repos","events_url":"https://api.github.com/users/overvenus/events{/privacy}","received_events_url":"https://api.github.com/users/overvenus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/overvenus/tidb","description":"TiDB is a distributed NewSQL database compatible with MySQL protocol ","fork":true,"url":"https://api.github.com/repos/overvenus/tidb","forks_url":"https://api.github.com/repos/overvenus/tidb/forks","keys_url":"https://api.github.com/repos/overvenus/tidb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/overvenus/tidb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/overvenus/tidb/teams","hooks_url":"https://api.github.com/repos/overvenus/tidb/hooks","issue_events_url":"https://api.github.com/repos/overvenus/tidb/issues/events{/number}","events_url":"https://api.github.com/repos/overvenus/tidb/events","assignees_url":"https://api.github.com/repos/overvenus/tidb/assignees{/user}","branches_url":"https://api.github.com/repos/overvenus/tidb/branches{/branch}","tags_url":"https://api.github.com/repos/overvenus/tidb/tags","blobs_url":"https://api.github.com/repos/overvenus/tidb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/overvenus/tidb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/overvenus/tidb/git/refs{/sha}","trees_url":"https://api.github.com/repos/overvenus/tidb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/overvenus/tidb/statuses/{sha}","languages_url":"https://api.github.com/repos/overvenus/tidb/languages","stargazers_url":"https://api.github.com/repos/overvenus/tidb/stargazers","contributors_url":"https://api.github.com/repos/overvenus/tidb/contributors","subscribers_url":"https://api.github.com/repos/overvenus/tidb/subscribers","subscription_url":"https://api.github.com/repos/overvenus/tidb/subscription","commits_url":"https://api.github.com/repos/overvenus/tidb/commits{/sha}","git_commits_url":"https://api.github.com/repos/overvenus/tidb/git/commits{/sha}","comments_url":"https://api.github.com/repos/overvenus/tidb/comments{/number}","issue_comment_url":"https://api.github.com/repos/overvenus/tidb/issues/comments{/number}","contents_url":"https://api.github.com/repos/overvenus/tidb/contents/{+path}","compare_url":"https://api.github.com/repos/overvenus/tidb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/overvenus/tidb/merges","archive_url":"https://api.github.com/repos/overvenus/tidb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/overvenus/tidb/downloads","issues_url":"https://api.github.com/repos/overvenus/tidb/issues{/number}","pulls_url":"https://api.github.com/repos/overvenus/tidb/pulls{/number}","milestones_url":"https://api.github.com/repos/overvenus/tidb/milestones{/number}","notifications_url":"https://api.github.com/repos/overvenus/tidb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/overvenus/tidb/labels{/name}","releases_url":"https://api.github.com/repos/overvenus/tidb/releases{/id}","deployments_url":"https://api.github.com/repos/overvenus/tidb/deployments","created_at":"2016-04-01T13:22:55Z","updated_at":"2016-04-01T13:22:57Z","pushed_at":"2016-04-01T14:09:02Z","git_url":"git://github.com/overvenus/tidb.git","ssh_url":"git@github.com:overvenus/tidb.git","clone_url":"https://github.com/overvenus/tidb.git","svn_url":"https://github.com/overvenus/tidb","homepage":"","size":11658,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"pingcap:master","ref":"master","sha":"8aa1055ceb3db20785957056375787be7cf73709","user":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars.githubusercontent.com/u/11855343?v=3","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"repo":{"id":41986369,"name":"tidb","full_name":"pingcap/tidb","owner":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars.githubusercontent.com/u/11855343?v=3","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pingcap/tidb","description":"TiDB is a distributed NewSQL database compatible with MySQL protocol ","fork":false,"url":"https://api.github.com/repos/pingcap/tidb","forks_url":"https://api.github.com/repos/pingcap/tidb/forks","keys_url":"https://api.github.com/repos/pingcap/tidb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pingcap/tidb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pingcap/tidb/teams","hooks_url":"https://api.github.com/repos/pingcap/tidb/hooks","issue_events_url":"https://api.github.com/repos/pingcap/tidb/issues/events{/number}","events_url":"https://api.github.com/repos/pingcap/tidb/events","assignees_url":"https://api.github.com/repos/pingcap/tidb/assignees{/user}","branches_url":"https://api.github.com/repos/pingcap/tidb/branches{/branch}","tags_url":"https://api.github.com/repos/pingcap/tidb/tags","blobs_url":"https://api.github.com/repos/pingcap/tidb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pingcap/tidb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pingcap/tidb/git/refs{/sha}","trees_url":"https://api.github.com/repos/pingcap/tidb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pingcap/tidb/statuses/{sha}","languages_url":"https://api.github.com/repos/pingcap/tidb/languages","stargazers_url":"https://api.github.com/repos/pingcap/tidb/stargazers","contributors_url":"https://api.github.com/repos/pingcap/tidb/contributors","subscribers_url":"https://api.github.com/repos/pingcap/tidb/subscribers","subscription_url":"https://api.github.com/repos/pingcap/tidb/subscription","commits_url":"https://api.github.com/repos/pingcap/tidb/commits{/sha}","git_commits_url":"https://api.github.com/repos/pingcap/tidb/git/commits{/sha}","comments_url":"https://api.github.com/repos/pingcap/tidb/comments{/number}","issue_comment_url":"https://api.github.com/repos/pingcap/tidb/issues/comments{/number}","contents_url":"https://api.github.com/repos/pingcap/tidb/contents/{+path}","compare_url":"https://api.github.com/repos/pingcap/tidb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pingcap/tidb/merges","archive_url":"https://api.github.com/repos/pingcap/tidb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pingcap/tidb/downloads","issues_url":"https://api.github.com/repos/pingcap/tidb/issues{/number}","pulls_url":"https://api.github.com/repos/pingcap/tidb/pulls{/number}","milestones_url":"https://api.github.com/repos/pingcap/tidb/milestones{/number}","notifications_url":"https://api.github.com/repos/pingcap/tidb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pingcap/tidb/labels{/name}","releases_url":"https://api.github.com/repos/pingcap/tidb/releases{/id}","deployments_url":"https://api.github.com/repos/pingcap/tidb/deployments","created_at":"2015-09-06T04:01:52Z","updated_at":"2016-04-01T07:21:12Z","pushed_at":"2016-04-01T14:12:40Z","git_url":"git://github.com/pingcap/tidb.git","ssh_url":"git@github.com:pingcap/tidb.git","clone_url":"https://github.com/pingcap/tidb.git","svn_url":"https://github.com/pingcap/tidb","homepage":"","size":12653,"stargazers_count":3637,"watchers_count":3637,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":425,"mirror_url":null,"open_issues_count":62,"forks":425,"open_issues":62,"watchers":3637,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/1045"},"html":{"href":"https://github.com/pingcap/tidb/pull/1045"},"issue":{"href":"https://api.github.com/repos/pingcap/tidb/issues/1045"},"comments":{"href":"https://api.github.com/repos/pingcap/tidb/issues/1045/comments"},"review_comments":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/1045/comments"},"review_comment":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/1045/commits"},"statuses":{"href":"https://api.github.com/repos/pingcap/tidb/statuses/440446b5b7fc99589fb68bc56306413bfecb6fd7"}}}}