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

rows.Close() must not overwrite buffer #903

Closed
methane opened this issue Dec 3, 2018 · 5 comments
Closed

rows.Close() must not overwrite buffer #903

methane opened this issue Dec 3, 2018 · 5 comments

Comments

@methane
Copy link
Member

methane commented Dec 3, 2018

Read these:

From Go 1.10, it's not allowed anymore. Maybe, it should be avoided from Go 1.9.
We should use another buffer...

This issue caused #902.

@DoctorQ

This comment has been minimized.

@methane

This comment has been minimized.

@methane
Copy link
Member Author

methane commented Dec 3, 2018

I think avoiding one allocation for each query is too difficult.

@vmg
Copy link
Contributor

vmg commented Apr 1, 2019

I've implemented a potential fix in #943 and discussed several other approaches which I believe are inferior to the one I'm proposing. Feedback is welcome.

@methane methane changed the title rows.Close() must not overwrite buffer used by rows.Next() rows.Close() must not overwrite buffer Apr 2, 2019
@methane
Copy link
Member Author

methane commented Apr 2, 2019

I created reproducer: https://gist.github.com/methane/418f872d788209116f8a5d08f756d838
go run -race reports race too.

To reproduce, we need to use sql.RawBytes or some Scanner object which doesn't deep copy []byte.

methane added a commit to methane/mysql that referenced this issue Apr 3, 2019
@methane methane closed this as completed in df597a2 Apr 4, 2019
@methane methane mentioned this issue Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants