-
Notifications
You must be signed in to change notification settings - Fork 427
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 for issue when attempting to insert an empty or null value on encrypted column #632
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #632 +/- ##
===========================================
+ Coverage 46.5% 46.57% +0.06%
- Complexity 2227 2231 +4
===========================================
Files 109 109
Lines 25431 25439 +8
Branches 4190 4190
===========================================
+ Hits 11827 11848 +21
+ Misses 11566 11546 -20
- Partials 2038 2045 +7
Continue to review full report at Codecov.
|
The workaround looks fine. After looking around the code, it seems like the valueLength is 0 if the user is using a callable statement and using the parameter as an output parameter. Have you considered this case / looked into what giving n/varchar(1) to the server implies? |
I think it should be fine since I just tried the same scenario with output parameter, and it seems to work fine, but I wanted you to consider this scenario as well. |
I tested the PR with both PreparedStatement and CallableStatement. |
Workaround for #624.
Currently, when inserting empty string or
null
into encrypted variable-length columns, the driver sets the data length to0
and the type totype(0)
(varchar(0)
for example). The workaround is to set the length to 1 and the type to type(1).