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

Added explicit key for using unsafe string reader #11

Merged
merged 3 commits into from
Jul 26, 2024

Conversation

agoncear-mwb
Copy link
Contributor

In the previous PR, the driver used the unsafe method getStringFromBytes for returning strings to the caller in the Next method.
This function was used to prevent memory allocation for strings since it just interprets the underlying byte array as a string and return it.
But without an explicit indication from the caller that we should use this method, we should instead return a new allocated string without all the overhead that reusing the byte array implies into the caller.

This PR address this issue and force the user wich want to use the unsafe function, to declare it in the connection parameters while opening the connection.
This will make the driver safer and will allow for a safer use from all the users.

@auxten
Copy link
Member

auxten commented Jul 26, 2024

LGTM

@auxten auxten merged commit f3d6a72 into chdb-io:main Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants