List:Internals« Previous MessageNext Message »
From:Sergei Golubchik Date:May 25 2005 11:00am
Subject:Re: Storageformat of Decimal values ...
View as plain text  
Hi!

On May 25, Hagen H?pfner wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> > No, it depends on the "pointer" size. (not C pointer, but a pointer
> > to a record - a record number for a fixed row_format). In MyISAM a
> > record cannot be shorter than a pointer size. Try to create, say, 8
> > decimal (1,0) fields, you'll see that every single one of then takes
> > only one byte.
> 
> Ok, but now let's come back to my initial question ;-) How to map a
> decimal value mapped to a bit sequence ... is it similar to
> real/float/double (IEEE 754) or do you use another method? Where can I
> find a detailed documentation about at least: how many bytes are
> required for what kind of decimal? You mentioned (1,0) requires one
> byte ... I know (18,9) requires 8 bytes (one byte for 9 digits) and
> (20,10) requires 10 bytes. But what happens in between?
> 
> I know this are a lot of questions, but I am really interested in
> understanding it (without analyzing all the source code in detail ;-)
> ) ...

Check the strings/decimal.c file in the source distribution - it
contains a comment with a description of the format.
 
Regards,
Sergei

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@stripped>
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, Senior Software Developer
/_/  /_/\_, /___/\___\_\___/  Osnabrueck, Germany
       <___/  www.mysql.com
Thread
Storageformat of Decimal values ...Hagen Höpfner24 May
  • Re: Storageformat of Decimal values ...Olaf van der Spek24 May
    • Re: Storageformat of Decimal values ...Hagen Höpfner24 May
  • Re: Storageformat of Decimal values ...Sergei Golubchik24 May
    • Re: Storageformat of Decimal values ...Hagen Höpfner24 May
      • Re: Storageformat of Decimal values ...Sergei Golubchik25 May
        • Re: Storageformat of Decimal values ...Hagen Höpfner25 May
          • Re: Storageformat of Decimal values ...Sergei Golubchik25 May