Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database/sql: should copy into []byte by default; add RawBytes type for speed #2698

Closed
bradfitz opened this issue Jan 13, 2012 · 2 comments
Closed
Assignees

Comments

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Jan 13, 2012

Row.Scan into a *[]byte does a copy.
Rows.Scan into a *[]byte does NOT.  (our original plan was speed)

for paranoia and consistency, Rows.Scan should also do a copy.

if the caller wants to minimize allocations, they can use a new named []byte type,
RawBytes

type RawBytes []byte

... and only Rows.Scan will permit that.
@bradfitz
Copy link
Contributor Author

@bradfitz bradfitz commented Jan 14, 2012

@bradfitz
Copy link
Contributor Author

@bradfitz bradfitz commented Jan 17, 2012

Comment 2:

This issue was closed by revision ebc8013.

Status changed to Fixed.

@bradfitz bradfitz added fixed labels Jan 17, 2012
@bradfitz bradfitz self-assigned this Jan 17, 2012
@mikioh mikioh changed the title exp/sql should copy into []byte by default; add RawBytes type for speed database/sql: should copy into []byte by default; add RawBytes type for speed Feb 18, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.