I open the ibd file of MySQL
InnoDB
engine and confused by the number two's complement.
For unsigned numbers, InnoDB used different representations.
the code '80 05' is the PAGE_N_HEAP field of innodb page header, which represent number of heap records, the real value is 5, explicitly is an unsigned number, but how the code '80 05' come from.
the code '00 03' is the PAGE_N_RECS field of the InnoDB page header, which represent the number of user records, the real value is 3, also an unsigned number, the code '00 03' can be understood as the two's complement of number 3.
the codes '00 00 00 01' and '00 00 00 02', is the user record id fields, which was defined as unsigned int, the codes also can be understanded as the tow's complement.
my question is why mysql use '80 05' represent the number 5.