• Brandon Nesterenko's avatar
    MDEV-33672: Gtid_log_event Construction from File Should Ensure Event Length When Using Extra Flags · 89c907bd
    Brandon Nesterenko authored
    A GTID event can have variable length, with contributing factors
    such as the variable length from the flags2 and optional extra flags
    fields. These fields are bitmaps, where each set bit indicates an
    additional value that should be appended to the event, e.g.
    multi-engine transactions append a number to indicate the number of
    additional engines a transaction uses. However, if a flags bit is
    set, and no additional fields are appended to the event, MDEV-33672
    reports that the server can still try to read from memory as if it
    did exist. Note, however, in debug builds, this condition is
    asserted for FL_EXTRA_MULTI_ENGINE.
    
    This patch fixes this to check that the length of the event is
    aligned with the expectation set by the flags for FL_PREPARED_XA,
    FL_COMPLETED_XA, and FL_EXTRA_MULTI_ENGINE.
    
    Reviewed By
    ============
    Kristian Nielsen <knielsen@knielsen-hq.org>
    89c907bd
rpl_gtid_header_valid.test 5 KB