List:Internals« Previous MessageNext Message »
From:Hagen Höpfner Date:May 24 2005 8:41am
Subject:Storageformat of Decimal values ...
View as plain text  
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear List,

I currently try to figure out, how decimal values are stored in MySQL. I
read about the changes in 5.0.3 but could not comprehend it under 5.0.4
beta. However,

http://dev.mysql.com/doc/mysql/en/precision-math-decimal-changes.html

mentioned, that 9 digits of a decimal value are stored in 4 byte. That
means, that Decimal(18,9) as well as Decimal(1,0) requires 8 Byte (4 for
the integer part and 4 for the fractional part). A Decimal (20,10)
should require one additional byte. So I created a MyISAM Table,
inserted a value and looked at the hexdump. But the Decimal(20,10) value
is also represented by 8 bytes.

Does anybody knows, how the conversion is done actually?

Hagen


- --
- ------------------------------------------------------------
Dr.-Ing. Hagen Höpfner | hoepfner@stripped | +49 7251 700 239
- ------------------------------------------------------------
         http://www.i-u.de/schools/hopfner/index.html

             International University in Germany
               School of Information Technology
                  Campus 3  D-76646 Bruchsal
- ------------------------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: GnuPT 2.6.0 by EQUIPMENTE.DE
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCkujXataeEpWdQtYRAvURAKDCz4V9uro/98q3vEgZ/SZpXhxJPQCfTkZk
jjmWRes8hBZd29bXIk8gVMY=
=GiX9
-----END PGP SIGNATURE-----
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