-
Notifications
You must be signed in to change notification settings - Fork 435
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
retrieve paramater encryption metadata if they are not retrieved yet #220
retrieve paramater encryption metadata if they are not retrieved yet #220
Conversation
We do not have GitHub test for AE yet, so I didn't add a test here. Even if we have AE test, how can we test it explicitly? I tested it manually. |
Codecov Report
@@ Coverage Diff @@
## dev #220 +/- ##
============================================
+ Coverage 32.87% 33.03% +0.15%
- Complexity 1437 1451 +14
============================================
Files 97 97
Lines 23385 23448 +63
Branches 3889 3896 +7
============================================
+ Hits 7688 7745 +57
+ Misses 14147 14145 -2
- Partials 1550 1558 +8
Continue to review full report at Codecov.
|
// retrieve paramater encryption metadata if they are not retrieved yet | ||
if (null == inOutParam[0].getCryptoMetadata()) { | ||
getParameterEncryptionMetadata(inOutParam); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this fix will work only if the first parameter is encrypted. Consider the case where first parameter is not encrypted, then it will fall back to the old behavior as inOutParam[0].getCryptoMetadata()
is null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you. fixed with flag
/** | ||
* Flag set to true when all encryption metadata of inOutParam is retrieved | ||
*/ | ||
private boolean encryptionMetadataISRetrieved = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update the variable name to camel case, encryptionMetadataIsRetrieved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah.. typo
double check if this needs to go inside the if block. |
@v-suhame we use this if block to increase performance. The line of code you mentioned does not break anything or degrade performance. It just set 2 values. There are a lot of places setting |
apply the changes for batch statement too. |
@v-suhame I noticed batch statement too but we do not need to apply changes for batch statement: since it's called only when |
It does break things if we do not call this line. This new logic was introduced to resolve inconsistent parameter definition problem between (AE on, no encryption) and (AE on, encryption used). |
thanks @v-xiangs, that clarifies it. If Also, hasNewTypeDefinitions should be updated with the result of |
@v-suhame Thank you for the very thoughtful code review. It does help me to remember the AE logic. For the first question: For the second question: |
Let me detail what I meant in the early comment. If there is a non encrypted smallmoney column, just having AE on in connection, and calling
with AE off, pstmt is not prepared every time.
As you are aware, |
@v-suhame I understand what you meant now. It does improve performance a lot. I am going to make the change now. Thank you. |
for issue #195