1

Given the following table, backed by MySQL 5.7/InnoDB:

CREATE TABLE mytable(mydouble DOUBLE) SELECT 0.005 `mydouble`;

how can I find what exactly InnoDB is storing on the disk for the value 0.005?

I know that this varies depending on the architecture, so I'm looking for a methodology rather than a certain value. I'm a programmer/dba, so I'm handy with any tool, if required.

asked Mar 15, 2018 at 19:29

1 Answer 1

1

A (very) poor man's strategy is to simply:

  • create a table with a known float value
  • perform a hex dump of the table ibd file
  • test against a hypothesis of how the value is stored

I've tested against the IEEE754 format value, but couldn't identify the value.

I've created the table adding a string value in the same record as the float, and I've actually found that the float storage format is actually IEEE754, but it's little endian.

answered Mar 15, 2018 at 22:37

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.