Optional Metadata fix for Minimal Row Based Replication #167
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.
This commit fixes the issue where we only advance the iterators for
columns that are present in the row image. The problem is that in
the table map event, the optional metadata is populated for all
columns, thus we need to advance the iterators even for columns that
are not present in the row event, otherwise we will be reading
metadata for the wrong column.
The fix is to keep all the logic of advancing the iterators for all
columns, and only populate the Column and value objects for the
columns that are present in the row event.
Test created with:
If we are not correctly parsing the row metadata, the following will
happen:
(UTF8MB4_0900_AI_CI) as we did not advance the metadata iterator due
to missing col_2 in the row image.
using the highest bit, the value will be interpreted as negative.
Closes: #162