Fix | Fix batch insert failing when AE is turned on#1378
Merged
ulvii merged 4 commits intomicrosoft:devfrom Jul 3, 2020
Merged
Fix | Fix batch insert failing when AE is turned on#1378ulvii merged 4 commits intomicrosoft:devfrom
ulvii merged 4 commits intomicrosoft:devfrom
Conversation
rene-ye
reviewed
Jul 3, 2020
lilgreenbird
approved these changes
Jul 3, 2020
rene-ye
approved these changes
Jul 3, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes issue #1301. Testing shows it also fixes #1360, but will need to confirm from user.
Continues from PR #1334. Testing has been carried over, but the fix is different.
The problem was coming from executing
sp_describe_parameter_encryption. This statement is executed when AE is turned on to retrieve the encryption parameter. Code was currently written in such a way thatsp_describe_paramter_encryptionwas being executed twice (or multiple times) if AE was enabled, which caused the driver to think that the current request was completed, which caused the driver to error out during the actual execution of the batch statement (and a plethora of other problems). Adding logic to only run param fetch once and save the encryption metadata for the subsequent batches as well solves this problem.Before: (PrecisionScaleTest::testMultiBatch)

After:

Testing was done against with both AE and AEv2 enabled.