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

fix: added check for null and undefined strings #194

Merged
merged 1 commit into from
Jan 24, 2021

Conversation

milenkovyua
Copy link
Contributor

I found a bug, where passing TVP with varchar column as parameter, filled with null values, leads to recording the data in SQL server, with "null", instead of NULL. This is caused because of the default behavior of V8, converting JavaScript values, to strings in C++, where null is converted into "null" and undefined is converted into "undefined".

This pull request is adding check for IsNull and IsUndefined on v8::Localv8::Value and fix this issue. If you need me, I can prepare an isolated environment, describing this behavior.

@milenkovyua
Copy link
Contributor Author

Do you want to discuss the changes? I am not very familiar with C++, so it probably could be written in a better way.

@TimelordUK
Copy link
Owner

TimelordUK commented Jan 21, 2021 via email

@TimelordUK TimelordUK merged commit 41eec6b into TimelordUK:master Jan 24, 2021
@TimelordUK
Copy link
Owner

I will be releasing this soon 2.0.11 - thanks for bringing this to our attention, in actual fact you found a general problem managing any bulk inset vector including nulls, in case of buffers actually causes a fatal crash.

I have added test cases and fixed the other types so hopefully this will sort things out.

thanks again

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