{"action":"created","comment":{"url":"https://api.github.com/repos/h2database/h2database/pulls/comments/202507957","pull_request_review_id":137230835,"id":202507957,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjUwNzk1Nw==","diff_hunk":"@@ -66,6 +68,87 @@ static InputStream rangeInputStream(InputStream inputStream, long oneBasedOffset\n         }\n     }\n \n+    /**\n+     * Compares LOBs of the same type.\n+     *\n+     * @param valueType type\n+     * @param v1 first LOB value\n+     * @param v2 second LOB value\n+     * @return result of comparison\n+     */\n+    static int compare(int valueType, Value v1, Value v2) {\n+        long prec1 = v1.getPrecision(), prec2 = v2.getPrecision();\n+        if (Math.max(prec1, prec2) <= BLOCK_COMPARISON_SIZE) {","path":"h2/src/main/org/h2/value/ValueLob.java","position":23,"original_position":23,"commit_id":"d48f308c1bb3c2628445cb4192481d185cecbf34","original_commit_id":"d48f308c1bb3c2628445cb4192481d185cecbf34","user":{"login":"katzyn","id":23182944,"node_id":"MDQ6VXNlcjIzMTgyOTQ0","avatar_url":"https://avatars0.githubusercontent.com/u/23182944?v=4","gravatar_id":"","url":"https://api.github.com/users/katzyn","html_url":"https://github.com/katzyn","followers_url":"https://api.github.com/users/katzyn/followers","following_url":"https://api.github.com/users/katzyn/following{/other_user}","gists_url":"https://api.github.com/users/katzyn/gists{/gist_id}","starred_url":"https://api.github.com/users/katzyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katzyn/subscriptions","organizations_url":"https://api.github.com/users/katzyn/orgs","repos_url":"https://api.github.com/users/katzyn/repos","events_url":"https://api.github.com/users/katzyn/events{/privacy}","received_events_url":"https://api.github.com/users/katzyn/received_events","type":"User","site_admin":false},"body":"And handler in `ValueLobDb` may be null. I think that for `ValueLobDb` presence of value in `small` field can be used instead, but with such check I need to rewrite unit test to cover all branches of code.","created_at":"2018-07-14T06:42:38Z","updated_at":"2018-07-14T06:42:38Z","html_url":"https://github.com/h2database/h2database/pull/1290#discussion_r202507957","pull_request_url":"https://api.github.com/repos/h2database/h2database/pulls/1290","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/h2database/h2database/pulls/comments/202507957"},"html":{"href":"https://github.com/h2database/h2database/pull/1290#discussion_r202507957"},"pull_request":{"href":"https://api.github.com/repos/h2database/h2database/pulls/1290"}},"in_reply_to_id":202507497},"pull_request":{"url":"https://api.github.com/repos/h2database/h2database/pulls/1290","id":201434406,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxNDM0NDA2","html_url":"https://github.com/h2database/h2database/pull/1290","diff_url":"https://github.com/h2database/h2database/pull/1290.diff","patch_url":"https://github.com/h2database/h2database/pull/1290.patch","issue_url":"https://api.github.com/repos/h2database/h2database/issues/1290","number":1290,"state":"open","locked":false,"title":"Do not load the whole LOBs into memory for comparison operation","user":{"login":"katzyn","id":23182944,"node_id":"MDQ6VXNlcjIzMTgyOTQ0","avatar_url":"https://avatars0.githubusercontent.com/u/23182944?v=4","gravatar_id":"","url":"https://api.github.com/users/katzyn","html_url":"https://github.com/katzyn","followers_url":"https://api.github.com/users/katzyn/followers","following_url":"https://api.github.com/users/katzyn/following{/other_user}","gists_url":"https://api.github.com/users/katzyn/gists{/gist_id}","starred_url":"https://api.github.com/users/katzyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katzyn/subscriptions","organizations_url":"https://api.github.com/users/katzyn/orgs","repos_url":"https://api.github.com/users/katzyn/repos","events_url":"https://api.github.com/users/katzyn/events{/privacy}","received_events_url":"https://api.github.com/users/katzyn/received_events","type":"User","site_admin":false},"body":"LOBs are not usually compared, but they may be involved sometimes in such operations in distinct selects (they probably should not be valid, by distinct may be requested by H2's internals and not by user), external results etc.\r\n\r\nA stream comparison operation for large LOBs is introduced here for both `ValueLob` and `ValueLobDb` for safety.","created_at":"2018-07-14T03:51:28Z","updated_at":"2018-07-14T06:42:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a786985c814db5aa794f03e3b83288bcdd363768","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/h2database/h2database/pulls/1290/commits","review_comments_url":"https://api.github.com/repos/h2database/h2database/pulls/1290/comments","review_comment_url":"https://api.github.com/repos/h2database/h2database/pulls/comments{/number}","comments_url":"https://api.github.com/repos/h2database/h2database/issues/1290/comments","statuses_url":"https://api.github.com/repos/h2database/h2database/statuses/d48f308c1bb3c2628445cb4192481d185cecbf34","head":{"label":"katzyn:lob_comparison","ref":"lob_comparison","sha":"d48f308c1bb3c2628445cb4192481d185cecbf34","user":{"login":"katzyn","id":23182944,"node_id":"MDQ6VXNlcjIzMTgyOTQ0","avatar_url":"https://avatars0.githubusercontent.com/u/23182944?v=4","gravatar_id":"","url":"https://api.github.com/users/katzyn","html_url":"https://github.com/katzyn","followers_url":"https://api.github.com/users/katzyn/followers","following_url":"https://api.github.com/users/katzyn/following{/other_user}","gists_url":"https://api.github.com/users/katzyn/gists{/gist_id}","starred_url":"https://api.github.com/users/katzyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katzyn/subscriptions","organizations_url":"https://api.github.com/users/katzyn/orgs","repos_url":"https://api.github.com/users/katzyn/repos","events_url":"https://api.github.com/users/katzyn/events{/privacy}","received_events_url":"https://api.github.com/users/katzyn/received_events","type":"User","site_admin":false},"repo":{"id":72628350,"node_id":"MDEwOlJlcG9zaXRvcnk3MjYyODM1MA==","name":"h2database","full_name":"katzyn/h2database","owner":{"login":"katzyn","id":23182944,"node_id":"MDQ6VXNlcjIzMTgyOTQ0","avatar_url":"https://avatars0.githubusercontent.com/u/23182944?v=4","gravatar_id":"","url":"https://api.github.com/users/katzyn","html_url":"https://github.com/katzyn","followers_url":"https://api.github.com/users/katzyn/followers","following_url":"https://api.github.com/users/katzyn/following{/other_user}","gists_url":"https://api.github.com/users/katzyn/gists{/gist_id}","starred_url":"https://api.github.com/users/katzyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katzyn/subscriptions","organizations_url":"https://api.github.com/users/katzyn/orgs","repos_url":"https://api.github.com/users/katzyn/repos","events_url":"https://api.github.com/users/katzyn/events{/privacy}","received_events_url":"https://api.github.com/users/katzyn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/katzyn/h2database","description":"H2 is an embeddable RDBMS written in Java.","fork":true,"url":"https://api.github.com/repos/katzyn/h2database","forks_url":"https://api.github.com/repos/katzyn/h2database/forks","keys_url":"https://api.github.com/repos/katzyn/h2database/keys{/key_id}","collaborators_url":"https://api.github.com/repos/katzyn/h2database/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/katzyn/h2database/teams","hooks_url":"https://api.github.com/repos/katzyn/h2database/hooks","issue_events_url":"https://api.github.com/repos/katzyn/h2database/issues/events{/number}","events_url":"https://api.github.com/repos/katzyn/h2database/events","assignees_url":"https://api.github.com/repos/katzyn/h2database/assignees{/user}","branches_url":"https://api.github.com/repos/katzyn/h2database/branches{/branch}","tags_url":"https://api.github.com/repos/katzyn/h2database/tags","blobs_url":"https://api.github.com/repos/katzyn/h2database/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/katzyn/h2database/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/katzyn/h2database/git/refs{/sha}","trees_url":"https://api.github.com/repos/katzyn/h2database/git/trees{/sha}","statuses_url":"https://api.github.com/repos/katzyn/h2database/statuses/{sha}","languages_url":"https://api.github.com/repos/katzyn/h2database/languages","stargazers_url":"https://api.github.com/repos/katzyn/h2database/stargazers","contributors_url":"https://api.github.com/repos/katzyn/h2database/contributors","subscribers_url":"https://api.github.com/repos/katzyn/h2database/subscribers","subscription_url":"https://api.github.com/repos/katzyn/h2database/subscription","commits_url":"https://api.github.com/repos/katzyn/h2database/commits{/sha}","git_commits_url":"https://api.github.com/repos/katzyn/h2database/git/commits{/sha}","comments_url":"https://api.github.com/repos/katzyn/h2database/comments{/number}","issue_comment_url":"https://api.github.com/repos/katzyn/h2database/issues/comments{/number}","contents_url":"https://api.github.com/repos/katzyn/h2database/contents/{+path}","compare_url":"https://api.github.com/repos/katzyn/h2database/compare/{base}...{head}","merges_url":"https://api.github.com/repos/katzyn/h2database/merges","archive_url":"https://api.github.com/repos/katzyn/h2database/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/katzyn/h2database/downloads","issues_url":"https://api.github.com/repos/katzyn/h2database/issues{/number}","pulls_url":"https://api.github.com/repos/katzyn/h2database/pulls{/number}","milestones_url":"https://api.github.com/repos/katzyn/h2database/milestones{/number}","notifications_url":"https://api.github.com/repos/katzyn/h2database/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/katzyn/h2database/labels{/name}","releases_url":"https://api.github.com/repos/katzyn/h2database/releases{/id}","deployments_url":"https://api.github.com/repos/katzyn/h2database/deployments","created_at":"2016-11-02T10:19:29Z","updated_at":"2018-07-14T01:37:28Z","pushed_at":"2018-07-14T03:43:57Z","git_url":"git://github.com/katzyn/h2database.git","ssh_url":"git@github.com:katzyn/h2database.git","clone_url":"https://github.com/katzyn/h2database.git","svn_url":"https://github.com/katzyn/h2database","homepage":"http://h2database.com","size":59701,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"h2database:master","ref":"master","sha":"1e4620041f86c76054424d656779f3d8f9e0d5bd","user":{"login":"h2database","id":11459762,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNDU5NzYy","avatar_url":"https://avatars2.githubusercontent.com/u/11459762?v=4","gravatar_id":"","url":"https://api.github.com/users/h2database","html_url":"https://github.com/h2database","followers_url":"https://api.github.com/users/h2database/followers","following_url":"https://api.github.com/users/h2database/following{/other_user}","gists_url":"https://api.github.com/users/h2database/gists{/gist_id}","starred_url":"https://api.github.com/users/h2database/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h2database/subscriptions","organizations_url":"https://api.github.com/users/h2database/orgs","repos_url":"https://api.github.com/users/h2database/repos","events_url":"https://api.github.com/users/h2database/events{/privacy}","received_events_url":"https://api.github.com/users/h2database/received_events","type":"Organization","site_admin":false},"repo":{"id":33745913,"node_id":"MDEwOlJlcG9zaXRvcnkzMzc0NTkxMw==","name":"h2database","full_name":"h2database/h2database","owner":{"login":"h2database","id":11459762,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNDU5NzYy","avatar_url":"https://avatars2.githubusercontent.com/u/11459762?v=4","gravatar_id":"","url":"https://api.github.com/users/h2database","html_url":"https://github.com/h2database","followers_url":"https://api.github.com/users/h2database/followers","following_url":"https://api.github.com/users/h2database/following{/other_user}","gists_url":"https://api.github.com/users/h2database/gists{/gist_id}","starred_url":"https://api.github.com/users/h2database/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h2database/subscriptions","organizations_url":"https://api.github.com/users/h2database/orgs","repos_url":"https://api.github.com/users/h2database/repos","events_url":"https://api.github.com/users/h2database/events{/privacy}","received_events_url":"https://api.github.com/users/h2database/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/h2database/h2database","description":"H2 is an embeddable RDBMS written in Java.","fork":false,"url":"https://api.github.com/repos/h2database/h2database","forks_url":"https://api.github.com/repos/h2database/h2database/forks","keys_url":"https://api.github.com/repos/h2database/h2database/keys{/key_id}","collaborators_url":"https://api.github.com/repos/h2database/h2database/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/h2database/h2database/teams","hooks_url":"https://api.github.com/repos/h2database/h2database/hooks","issue_events_url":"https://api.github.com/repos/h2database/h2database/issues/events{/number}","events_url":"https://api.github.com/repos/h2database/h2database/events","assignees_url":"https://api.github.com/repos/h2database/h2database/assignees{/user}","branches_url":"https://api.github.com/repos/h2database/h2database/branches{/branch}","tags_url":"https://api.github.com/repos/h2database/h2database/tags","blobs_url":"https://api.github.com/repos/h2database/h2database/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/h2database/h2database/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/h2database/h2database/git/refs{/sha}","trees_url":"https://api.github.com/repos/h2database/h2database/git/trees{/sha}","statuses_url":"https://api.github.com/repos/h2database/h2database/statuses/{sha}","languages_url":"https://api.github.com/repos/h2database/h2database/languages","stargazers_url":"https://api.github.com/repos/h2database/h2database/stargazers","contributors_url":"https://api.github.com/repos/h2database/h2database/contributors","subscribers_url":"https://api.github.com/repos/h2database/h2database/subscribers","subscription_url":"https://api.github.com/repos/h2database/h2database/subscription","commits_url":"https://api.github.com/repos/h2database/h2database/commits{/sha}","git_commits_url":"https://api.github.com/repos/h2database/h2database/git/commits{/sha}","comments_url":"https://api.github.com/repos/h2database/h2database/comments{/number}","issue_comment_url":"https://api.github.com/repos/h2database/h2database/issues/comments{/number}","contents_url":"https://api.github.com/repos/h2database/h2database/contents/{+path}","compare_url":"https://api.github.com/repos/h2database/h2database/compare/{base}...{head}","merges_url":"https://api.github.com/repos/h2database/h2database/merges","archive_url":"https://api.github.com/repos/h2database/h2database/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/h2database/h2database/downloads","issues_url":"https://api.github.com/repos/h2database/h2database/issues{/number}","pulls_url":"https://api.github.com/repos/h2database/h2database/pulls{/number}","milestones_url":"https://api.github.com/repos/h2database/h2database/milestones{/number}","notifications_url":"https://api.github.com/repos/h2database/h2database/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/h2database/h2database/labels{/name}","releases_url":"https://api.github.com/repos/h2database/h2database/releases{/id}","deployments_url":"https://api.github.com/repos/h2database/h2database/deployments","created_at":"2015-04-10T19:09:09Z","updated_at":"2018-07-13T15:30:54Z","pushed_at":"2018-07-14T03:51:29Z","git_url":"git://github.com/h2database/h2database.git","ssh_url":"git@github.com:h2database/h2database.git","clone_url":"https://github.com/h2database/h2database.git","svn_url":"https://github.com/h2database/h2database","homepage":"http://h2database.com","size":61177,"stargazers_count":1293,"watchers_count":1293,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":476,"mirror_url":null,"archived":false,"open_issues_count":120,"license":null,"forks":476,"open_issues":120,"watchers":1293,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/h2database/h2database/pulls/1290"},"html":{"href":"https://github.com/h2database/h2database/pull/1290"},"issue":{"href":"https://api.github.com/repos/h2database/h2database/issues/1290"},"comments":{"href":"https://api.github.com/repos/h2database/h2database/issues/1290/comments"},"review_comments":{"href":"https://api.github.com/repos/h2database/h2database/pulls/1290/comments"},"review_comment":{"href":"https://api.github.com/repos/h2database/h2database/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/h2database/h2database/pulls/1290/commits"},"statuses":{"href":"https://api.github.com/repos/h2database/h2database/statuses/d48f308c1bb3c2628445cb4192481d185cecbf34"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"katzyn"}}