Hi!
On Jun 13, Hagen H?pfner wrote:
> Sergei Golubchik schrieb:
> >On Jun 13, Hagen H?pfner wrote:
> >
> >>-----BEGIN PGP SIGNED MESSAGE-----
> >>Hash: SHA1
> >>
> >>Dear list,
> >>
> >>can somebody tell me some details about the header of variable lengths
> >>rows? The internals-documentation helps a little bit but is not enough
> >>;-) Thats what I believe to know so far:
> >>
> >>(1) The first byte is a flag for the type of the row ... deleted=0x00,
> >>"normal"=0x03, "splitted_first_part"=0x05 "splitted_second_part"=0x09
> >>... Where are the flags documented in the source code?
> >>
> >>(2) I did not find out where the second byte is used for. In my
> >>examples it is always 0x00.
> >
> >No real documentation, unfortunately.
> >But check mi_dynrec.c, the last function: _mi_get_block_info().
> >And note return values.
> >
> OK, that describes the first byte of the header but what is the second
> one used for?
Everything is there. E.g.:
case 1:
info->rec_len=info->data_len=info->block_len=mi_uint2korr(header+1);
info->filepos=filepos+3;
return return_val | BLOCK_FIRST | BLOCK_LAST;
It shows that if the first byte is 1, then it's a row, that takes one
block (the block is both "first" and "last" in a chain), second and
third bytes - mi_uint2korr(header+1) - store the record length,
while data length, and block length are equal to the record length.
Regards,
Sergei
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <serg@stripped>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Senior Software Developer
/_/ /_/\_, /___/\___\_\___/ Osnabrueck, Germany
<___/ www.mysql.com