{"action":"created","comment":{"url":"https://api.github.com/repos/python/cpython/pulls/comments/200682854","pull_request_review_id":135049708,"id":200682854,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDY4Mjg1NA==","diff_hunk":"@@ -810,24 +810,50 @@ static void _pysqlite_drop_unused_cursor_references(pysqlite_Connection* self)\n \n PyObject* pysqlite_connection_create_function(pysqlite_Connection* self, PyObject* args, PyObject* kwargs)\n {\n-    static char *kwlist[] = {\"name\", \"narg\", \"func\", NULL, NULL};\n+    static char *kwlist[] = {\"name\", \"narg\", \"func\", \"deterministic\", NULL};\n \n     PyObject* func;\n     char* name;\n     int narg;\n     int rc;\n+    int deterministic = 0;\n+    int eTextRep = SQLITE_UTF8;\n \n     if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {\n         return NULL;\n     }\n \n-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, \"siO\", kwlist,\n-                                     &name, &narg, &func))\n+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, \"siO|$p\", kwlist,\n+                                     &name, &narg, &func, &deterministic))\n     {\n         return NULL;\n     }\n \n-    rc = sqlite3_create_function(self->db, name, narg, SQLITE_UTF8, (void*)func, _pysqlite_func_callback, NULL, NULL);\n+    if (deterministic) {\n+#if SQLITE_VERSION_NUMBER < 3008003\n+        PyErr_SetString(pysqlite_NotSupportedError,\n+                        \"should be built with SQLite 3.8.3 or higher\");\n+        return NULL;\n+#else\n+        if (sqlite3_libversion_number() < 3008003) {","path":"Modules/_sqlite/connection.c","position":33,"original_position":33,"commit_id":"0dcc22cfcd4d07f4f05a0a6f7a64446a019e48eb","original_commit_id":"0bfe04a12965b2db07db2dc2899ed1c551b5413a","user":{"login":"vstinner","id":194129,"node_id":"MDQ6VXNlcjE5NDEyOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/194129?v=4","gravatar_id":"","url":"https://api.github.com/users/vstinner","html_url":"https://github.com/vstinner","followers_url":"https://api.github.com/users/vstinner/followers","following_url":"https://api.github.com/users/vstinner/following{/other_user}","gists_url":"https://api.github.com/users/vstinner/gists{/gist_id}","starred_url":"https://api.github.com/users/vstinner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vstinner/subscriptions","organizations_url":"https://api.github.com/users/vstinner/orgs","repos_url":"https://api.github.com/users/vstinner/repos","events_url":"https://api.github.com/users/vstinner/events{/privacy}","received_events_url":"https://api.github.com/users/vstinner/received_events","type":"User","site_admin":false},"body":"+1 for the runtime check\r\n\r\nChecking the runtime version is fine. SQLITE_VERSION_NUMBER is the build version. Using Linux packages, it's common that the machine building packages and the users installing packages use different versions.\r\n\r\nIt also seems risky to use the flag on old versions according to the discussion in this PR.","created_at":"2018-07-06T15:08:37Z","updated_at":"2018-07-06T15:08:53Z","html_url":"https://github.com/python/cpython/pull/8086#discussion_r200682854","pull_request_url":"https://api.github.com/repos/python/cpython/pulls/8086","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/python/cpython/pulls/comments/200682854"},"html":{"href":"https://github.com/python/cpython/pull/8086#discussion_r200682854"},"pull_request":{"href":"https://api.github.com/repos/python/cpython/pulls/8086"}},"in_reply_to_id":200585844},"pull_request":{"url":"https://api.github.com/repos/python/cpython/pulls/8086","id":199200511,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5MjAwNTEx","html_url":"https://github.com/python/cpython/pull/8086","diff_url":"https://github.com/python/cpython/pull/8086.diff","patch_url":"https://github.com/python/cpython/pull/8086.patch","issue_url":"https://api.github.com/repos/python/cpython/issues/8086","number":8086,"state":"open","locked":false,"title":"bpo-34041: Added *deterministic* parameter to sqlite3.Connection.create_function().","user":{"login":"sir-sigurd","id":481910,"node_id":"MDQ6VXNlcjQ4MTkxMA==","avatar_url":"https://avatars1.githubusercontent.com/u/481910?v=4","gravatar_id":"","url":"https://api.github.com/users/sir-sigurd","html_url":"https://github.com/sir-sigurd","followers_url":"https://api.github.com/users/sir-sigurd/followers","following_url":"https://api.github.com/users/sir-sigurd/following{/other_user}","gists_url":"https://api.github.com/users/sir-sigurd/gists{/gist_id}","starred_url":"https://api.github.com/users/sir-sigurd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sir-sigurd/subscriptions","organizations_url":"https://api.github.com/users/sir-sigurd/orgs","repos_url":"https://api.github.com/users/sir-sigurd/repos","events_url":"https://api.github.com/users/sir-sigurd/events{/privacy}","received_events_url":"https://api.github.com/users/sir-sigurd/received_events","type":"User","site_admin":false},"body":"\r\n\r\n<!--\r\nThanks for your contribution!\r\nPlease read this comment in its entirety. It's quite important.\r\n\r\n# Pull Request title\r\n\r\nIt should be in the following format:\r\n\r\n```\r\nbpo-NNNN: Summary of the changes made\r\n```\r\n\r\nWhere: bpo-NNNN refers to the issue number in the https://bugs.python.org.\r\n\r\nMost PRs will require an issue number. Trivial changes, like fixing a typo, do not need an issue.\r\n\r\n# Backport Pull Request title\r\n\r\nIf this is a backport PR (PR made against branches other than `master`),\r\nplease ensure that the PR title is in the following format:\r\n\r\n```\r\n[X.Y] <title from the original PR> (GH-NNNN)\r\n```\r\n\r\nWhere: [X.Y] is the branch name, e.g. [3.6].\r\n\r\nGH-NNNN refers to the PR number from `master`.\r\n\r\n-->\r\n\n\n<!-- issue-number: bpo-34041 -->\nhttps://bugs.python.org/issue34041\n<!-- /issue-number -->\n","created_at":"2018-07-04T10:06:00Z","updated_at":"2018-07-06T15:08:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"46b10d1dcba1f6e7d1a094f0d2d47e980d0e779c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":536945472,"node_id":"MDU6TGFiZWw1MzY5NDU0NzI=","url":"https://api.github.com/repos/python/cpython/labels/CLA%20signed","name":"CLA signed","color":"0e8a16","default":false},{"id":666979988,"node_id":"MDU6TGFiZWw2NjY5Nzk5ODg=","url":"https://api.github.com/repos/python/cpython/labels/awaiting%20change%20review","name":"awaiting change review","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/python/cpython/pulls/8086/commits","review_comments_url":"https://api.github.com/repos/python/cpython/pulls/8086/comments","review_comment_url":"https://api.github.com/repos/python/cpython/pulls/comments{/number}","comments_url":"https://api.github.com/repos/python/cpython/issues/8086/comments","statuses_url":"https://api.github.com/repos/python/cpython/statuses/0dcc22cfcd4d07f4f05a0a6f7a64446a019e48eb","head":{"label":"sir-sigurd:sqlite-deterministic-function","ref":"sqlite-deterministic-function","sha":"0dcc22cfcd4d07f4f05a0a6f7a64446a019e48eb","user":{"login":"sir-sigurd","id":481910,"node_id":"MDQ6VXNlcjQ4MTkxMA==","avatar_url":"https://avatars1.githubusercontent.com/u/481910?v=4","gravatar_id":"","url":"https://api.github.com/users/sir-sigurd","html_url":"https://github.com/sir-sigurd","followers_url":"https://api.github.com/users/sir-sigurd/followers","following_url":"https://api.github.com/users/sir-sigurd/following{/other_user}","gists_url":"https://api.github.com/users/sir-sigurd/gists{/gist_id}","starred_url":"https://api.github.com/users/sir-sigurd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sir-sigurd/subscriptions","organizations_url":"https://api.github.com/users/sir-sigurd/orgs","repos_url":"https://api.github.com/users/sir-sigurd/repos","events_url":"https://api.github.com/users/sir-sigurd/events{/privacy}","received_events_url":"https://api.github.com/users/sir-sigurd/received_events","type":"User","site_admin":false},"repo":{"id":94994425,"node_id":"MDEwOlJlcG9zaXRvcnk5NDk5NDQyNQ==","name":"cpython","full_name":"sir-sigurd/cpython","owner":{"login":"sir-sigurd","id":481910,"node_id":"MDQ6VXNlcjQ4MTkxMA==","avatar_url":"https://avatars1.githubusercontent.com/u/481910?v=4","gravatar_id":"","url":"https://api.github.com/users/sir-sigurd","html_url":"https://github.com/sir-sigurd","followers_url":"https://api.github.com/users/sir-sigurd/followers","following_url":"https://api.github.com/users/sir-sigurd/following{/other_user}","gists_url":"https://api.github.com/users/sir-sigurd/gists{/gist_id}","starred_url":"https://api.github.com/users/sir-sigurd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sir-sigurd/subscriptions","organizations_url":"https://api.github.com/users/sir-sigurd/orgs","repos_url":"https://api.github.com/users/sir-sigurd/repos","events_url":"https://api.github.com/users/sir-sigurd/events{/privacy}","received_events_url":"https://api.github.com/users/sir-sigurd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sir-sigurd/cpython","description":"The Python programming language","fork":true,"url":"https://api.github.com/repos/sir-sigurd/cpython","forks_url":"https://api.github.com/repos/sir-sigurd/cpython/forks","keys_url":"https://api.github.com/repos/sir-sigurd/cpython/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sir-sigurd/cpython/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sir-sigurd/cpython/teams","hooks_url":"https://api.github.com/repos/sir-sigurd/cpython/hooks","issue_events_url":"https://api.github.com/repos/sir-sigurd/cpython/issues/events{/number}","events_url":"https://api.github.com/repos/sir-sigurd/cpython/events","assignees_url":"https://api.github.com/repos/sir-sigurd/cpython/assignees{/user}","branches_url":"https://api.github.com/repos/sir-sigurd/cpython/branches{/branch}","tags_url":"https://api.github.com/repos/sir-sigurd/cpython/tags","blobs_url":"https://api.github.com/repos/sir-sigurd/cpython/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sir-sigurd/cpython/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sir-sigurd/cpython/git/refs{/sha}","trees_url":"https://api.github.com/repos/sir-sigurd/cpython/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sir-sigurd/cpython/statuses/{sha}","languages_url":"https://api.github.com/repos/sir-sigurd/cpython/languages","stargazers_url":"https://api.github.com/repos/sir-sigurd/cpython/stargazers","contributors_url":"https://api.github.com/repos/sir-sigurd/cpython/contributors","subscribers_url":"https://api.github.com/repos/sir-sigurd/cpython/subscribers","subscription_url":"https://api.github.com/repos/sir-sigurd/cpython/subscription","commits_url":"https://api.github.com/repos/sir-sigurd/cpython/commits{/sha}","git_commits_url":"https://api.github.com/repos/sir-sigurd/cpython/git/commits{/sha}","comments_url":"https://api.github.com/repos/sir-sigurd/cpython/comments{/number}","issue_comment_url":"https://api.github.com/repos/sir-sigurd/cpython/issues/comments{/number}","contents_url":"https://api.github.com/repos/sir-sigurd/cpython/contents/{+path}","compare_url":"https://api.github.com/repos/sir-sigurd/cpython/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sir-sigurd/cpython/merges","archive_url":"https://api.github.com/repos/sir-sigurd/cpython/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sir-sigurd/cpython/downloads","issues_url":"https://api.github.com/repos/sir-sigurd/cpython/issues{/number}","pulls_url":"https://api.github.com/repos/sir-sigurd/cpython/pulls{/number}","milestones_url":"https://api.github.com/repos/sir-sigurd/cpython/milestones{/number}","notifications_url":"https://api.github.com/repos/sir-sigurd/cpython/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sir-sigurd/cpython/labels{/name}","releases_url":"https://api.github.com/repos/sir-sigurd/cpython/releases{/id}","deployments_url":"https://api.github.com/repos/sir-sigurd/cpython/deployments","created_at":"2017-06-21T10:53:33Z","updated_at":"2017-06-21T10:53:57Z","pushed_at":"2018-07-06T10:43:05Z","git_url":"git://github.com/sir-sigurd/cpython.git","ssh_url":"git@github.com:sir-sigurd/cpython.git","clone_url":"https://github.com/sir-sigurd/cpython.git","svn_url":"https://github.com/sir-sigurd/cpython","homepage":"https://www.python.org/","size":232080,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"python:master","ref":"master","sha":"07888e1cce89e9bb7dc501e287b4cb126e01c378","user":{"login":"python","id":1525981,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MjU5ODE=","avatar_url":"https://avatars3.githubusercontent.com/u/1525981?v=4","gravatar_id":"","url":"https://api.github.com/users/python","html_url":"https://github.com/python","followers_url":"https://api.github.com/users/python/followers","following_url":"https://api.github.com/users/python/following{/other_user}","gists_url":"https://api.github.com/users/python/gists{/gist_id}","starred_url":"https://api.github.com/users/python/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python/subscriptions","organizations_url":"https://api.github.com/users/python/orgs","repos_url":"https://api.github.com/users/python/repos","events_url":"https://api.github.com/users/python/events{/privacy}","received_events_url":"https://api.github.com/users/python/received_events","type":"Organization","site_admin":false},"repo":{"id":81598961,"node_id":"MDEwOlJlcG9zaXRvcnk4MTU5ODk2MQ==","name":"cpython","full_name":"python/cpython","owner":{"login":"python","id":1525981,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MjU5ODE=","avatar_url":"https://avatars3.githubusercontent.com/u/1525981?v=4","gravatar_id":"","url":"https://api.github.com/users/python","html_url":"https://github.com/python","followers_url":"https://api.github.com/users/python/followers","following_url":"https://api.github.com/users/python/following{/other_user}","gists_url":"https://api.github.com/users/python/gists{/gist_id}","starred_url":"https://api.github.com/users/python/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python/subscriptions","organizations_url":"https://api.github.com/users/python/orgs","repos_url":"https://api.github.com/users/python/repos","events_url":"https://api.github.com/users/python/events{/privacy}","received_events_url":"https://api.github.com/users/python/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/python/cpython","description":"The Python programming language","fork":false,"url":"https://api.github.com/repos/python/cpython","forks_url":"https://api.github.com/repos/python/cpython/forks","keys_url":"https://api.github.com/repos/python/cpython/keys{/key_id}","collaborators_url":"https://api.github.com/repos/python/cpython/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/python/cpython/teams","hooks_url":"https://api.github.com/repos/python/cpython/hooks","issue_events_url":"https://api.github.com/repos/python/cpython/issues/events{/number}","events_url":"https://api.github.com/repos/python/cpython/events","assignees_url":"https://api.github.com/repos/python/cpython/assignees{/user}","branches_url":"https://api.github.com/repos/python/cpython/branches{/branch}","tags_url":"https://api.github.com/repos/python/cpython/tags","blobs_url":"https://api.github.com/repos/python/cpython/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/python/cpython/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/python/cpython/git/refs{/sha}","trees_url":"https://api.github.com/repos/python/cpython/git/trees{/sha}","statuses_url":"https://api.github.com/repos/python/cpython/statuses/{sha}","languages_url":"https://api.github.com/repos/python/cpython/languages","stargazers_url":"https://api.github.com/repos/python/cpython/stargazers","contributors_url":"https://api.github.com/repos/python/cpython/contributors","subscribers_url":"https://api.github.com/repos/python/cpython/subscribers","subscription_url":"https://api.github.com/repos/python/cpython/subscription","commits_url":"https://api.github.com/repos/python/cpython/commits{/sha}","git_commits_url":"https://api.github.com/repos/python/cpython/git/commits{/sha}","comments_url":"https://api.github.com/repos/python/cpython/comments{/number}","issue_comment_url":"https://api.github.com/repos/python/cpython/issues/comments{/number}","contents_url":"https://api.github.com/repos/python/cpython/contents/{+path}","compare_url":"https://api.github.com/repos/python/cpython/compare/{base}...{head}","merges_url":"https://api.github.com/repos/python/cpython/merges","archive_url":"https://api.github.com/repos/python/cpython/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/python/cpython/downloads","issues_url":"https://api.github.com/repos/python/cpython/issues{/number}","pulls_url":"https://api.github.com/repos/python/cpython/pulls{/number}","milestones_url":"https://api.github.com/repos/python/cpython/milestones{/number}","notifications_url":"https://api.github.com/repos/python/cpython/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/python/cpython/labels{/name}","releases_url":"https://api.github.com/repos/python/cpython/releases{/id}","deployments_url":"https://api.github.com/repos/python/cpython/deployments","created_at":"2017-02-10T19:23:51Z","updated_at":"2018-07-06T13:48:43Z","pushed_at":"2018-07-06T12:14:34Z","git_url":"git://github.com/python/cpython.git","ssh_url":"git@github.com:python/cpython.git","clone_url":"https://github.com/python/cpython.git","svn_url":"https://github.com/python/cpython","homepage":"https://www.python.org/","size":243080,"stargazers_count":18510,"watchers_count":18510,"language":"Python","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5906,"mirror_url":null,"archived":false,"open_issues_count":781,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":5906,"open_issues":781,"watchers":18510,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/python/cpython/pulls/8086"},"html":{"href":"https://github.com/python/cpython/pull/8086"},"issue":{"href":"https://api.github.com/repos/python/cpython/issues/8086"},"comments":{"href":"https://api.github.com/repos/python/cpython/issues/8086/comments"},"review_comments":{"href":"https://api.github.com/repos/python/cpython/pulls/8086/comments"},"review_comment":{"href":"https://api.github.com/repos/python/cpython/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/python/cpython/pulls/8086/commits"},"statuses":{"href":"https://api.github.com/repos/python/cpython/statuses/0dcc22cfcd4d07f4f05a0a6f7a64446a019e48eb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"vstinner"}}