Confusing in parsing mysqlbinlog

I am trying to write a MySQL binlog parse, when parsing anonymous gtid events, MySQL internal manual doesn’t contain struct description of anonmyous gtid events. I found following doc in MySQL server source code

  @section Gtid_event_binary_format Binary Format    The Body has seven components:    <table>   <caption>Body for Gtid_event</caption>    <tr>     <th>Name</th>     <th>Format</th>     <th>Description</th>   </tr>    </tr>   <tr>     <td>GTID_FLAGS</td>     <td>1 byte</td>     <td>00000001 = Transaction may have changes logged with SBR.         In 5.6, 5.7.0-5.7.18, and 8.0.0-8.0.1, this flag is always set.         Starting in 5.7.19 and 8.0.2, this flag is cleared if the transaction         only contains row events. It is set if any part of the transaction is         written in statement format.</td>   </tr>   <tr>     <td>ENCODED_SID_LENGTH</td>     <td>4 bytes static const integer</td>     <td>Length of SID in event encoding</td>   </tr>   <tr>     <td>ENCODED_GNO_LENGTH</td>     <td>4 bytes static const integer</td>     <td>Length of GNO in event encoding.</td>   </tr>   <tr>     <td>last_committed</td>     <td>8 byte integer</td>     <td>Store the transaction's commit parent sequence_number</td>   </tr>   <tr>     <td>sequence_number</td>     <td>8 byte integer</td>     <td>The transaction's logical timestamp assigned at prepare phase</td>   </tr>   </table>  */  

But it doesn’t match output of running mysqlbinlog -v <binlog.log>

#200709 15:41:10 server id 1  end_log_pos 219 CRC32 0x4f99babc  # Position  Timestamp   Type   Master ID        Size      Master Pos    Flags  #       9a 96 3a 07 5f   22   01 00 00 00   41 00 00 00   db 00 00 00   00 00 #       ad 01 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00 |................| #       bd 00 00 00 00 00 00 00 00  00 02 00 00 00 00 00 00 |................| #       cd 00 00 01 00 00 00 00 00  00 00 bc ba 99 4f       |.............O| #   Anonymous_GTID  last_committed=0    sequence_number=1   rbr_only=no SET @@SESSION.GTID_NEXT= 'ANONYMOUS'/*!*/; 

mysql version 5.7.30

Am I find wrong doc and what’s the real struct of anonyoums?

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.