{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/14078","repository_url":"https://api.github.com/repos/cockroachdb/cockroach","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/14078/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/14078/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/14078/events","html_url":"https://github.com/cockroachdb/cockroach/pull/14078","id":213435827,"number":14078,"title":"sql: copy the input to (*tableUpserter).row","user":{"login":"danhhz","id":52528,"avatar_url":"https://avatars2.githubusercontent.com/u/52528?v=3","gravatar_id":"","url":"https://api.github.com/users/danhhz","html_url":"https://github.com/danhhz","followers_url":"https://api.github.com/users/danhhz/followers","following_url":"https://api.github.com/users/danhhz/following{/other_user}","gists_url":"https://api.github.com/users/danhhz/gists{/gist_id}","starred_url":"https://api.github.com/users/danhhz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danhhz/subscriptions","organizations_url":"https://api.github.com/users/danhhz/orgs","repos_url":"https://api.github.com/users/danhhz/repos","events_url":"https://api.github.com/users/danhhz/events{/privacy}","received_events_url":"https://api.github.com/users/danhhz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"dt","id":15615,"avatar_url":"https://avatars1.githubusercontent.com/u/15615?v=3","gravatar_id":"","url":"https://api.github.com/users/dt","html_url":"https://github.com/dt","followers_url":"https://api.github.com/users/dt/followers","following_url":"https://api.github.com/users/dt/following{/other_user}","gists_url":"https://api.github.com/users/dt/gists{/gist_id}","starred_url":"https://api.github.com/users/dt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dt/subscriptions","organizations_url":"https://api.github.com/users/dt/orgs","repos_url":"https://api.github.com/users/dt/repos","events_url":"https://api.github.com/users/dt/events{/privacy}","received_events_url":"https://api.github.com/users/dt/received_events","type":"User","site_admin":false},"assignees":[{"login":"dt","id":15615,"avatar_url":"https://avatars1.githubusercontent.com/u/15615?v=3","gravatar_id":"","url":"https://api.github.com/users/dt","html_url":"https://github.com/dt","followers_url":"https://api.github.com/users/dt/followers","following_url":"https://api.github.com/users/dt/following{/other_user}","gists_url":"https://api.github.com/users/dt/gists{/gist_id}","starred_url":"https://api.github.com/users/dt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dt/subscriptions","organizations_url":"https://api.github.com/users/dt/orgs","repos_url":"https://api.github.com/users/dt/repos","events_url":"https://api.github.com/users/dt/events{/privacy}","received_events_url":"https://api.github.com/users/dt/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2017-03-10T19:51:16Z","updated_at":"2017-03-13T17:24:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/14078","html_url":"https://github.com/cockroachdb/cockroach/pull/14078","diff_url":"https://github.com/cockroachdb/cockroach/pull/14078.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/14078.patch"},"body":"The caller of this method was getting a row from (planNode).Values,\r\nwhich doesn't guarantee that it will exist after the next call to Next.\r\nCopy it here instead of sql.Insert because tableInserter doesn't need a\r\ncopy, so we save the allocations on non-upsert INSERTs.\r\n\r\nThe existing tests happened to get planNodes that didn't reuse rows, so\r\nthey unfortunately didn't catch it.\r\n\r\nCloses #14052.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/cockroachdb/cockroach/14078)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/286180203","html_url":"https://github.com/cockroachdb/cockroach/pull/14078#issuecomment-286180203","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/14078","id":286180203,"user":{"login":"knz","id":642886,"avatar_url":"https://avatars0.githubusercontent.com/u/642886?v=3","gravatar_id":"","url":"https://api.github.com/users/knz","html_url":"https://github.com/knz","followers_url":"https://api.github.com/users/knz/followers","following_url":"https://api.github.com/users/knz/following{/other_user}","gists_url":"https://api.github.com/users/knz/gists{/gist_id}","starred_url":"https://api.github.com/users/knz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knz/subscriptions","organizations_url":"https://api.github.com/users/knz/orgs","repos_url":"https://api.github.com/users/knz/repos","events_url":"https://api.github.com/users/knz/events{/privacy}","received_events_url":"https://api.github.com/users/knz/received_events","type":"User","site_admin":false},"created_at":"2017-03-13T17:24:54Z","updated_at":"2017-03-13T17:24:54Z","body":"Why does the tableUpserter need to use the datum array after the next call to the source's Next()."}}
{"actor":{"display_login":"knz"}}