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.
MDEV-37674 Refactor Optional_metadata_fields storage
Replace std::vector-based Optional_metadata_fields members with a
more structured representation aligned with MariaDB internal types.
This refactoring simplifies memory allocation, reduces fragmentation,
and prepares the code for using Column_definition as the canonical
holder for column metadata.
No functional behavior is changed.
Description
Table_map_log_event::Optional_metadata_fieldscurrently stores per-columnmetadata using multiple
std::vectormembers, one for each optionalattribute (types, flags, lengths, etc.).
This design leads to:
This PR refactors the internal representation to move away from
std::vector-heavy storage and align metadata handling with MariaDBinternal column structures. The change simplifies memory management,
makes the code easier to reason about, and prepares the ground for
using
Column_definitionas the single authoritative metadata holder.This work was split out from MDEV-37674, which previously removed
std::stringusage from the same area.No functional behavior or binary log format is changed.
Release Notes
Internal refactoring of replication log event metadata handling.
No user-visible behavior changes.
How can this PR be tested?
This change is a structural refactoring with no functional behavior
changes. Existing replication and binlog test coverage exercises the
affected code paths.
Recommended validation:
No new tests were added since behavior remains unchanged.
Basing the PR against the correct MariaDB version
mainbranch.PR quality check
PR quality check