Crazy automatic float rounding in MySQL 5.7 My exact MySQL version is 5.7.29-0ubuntu0.18.04.1.
And I'm beginning to think that I'm getting crazy...

Just try these queries:

CREATE TABLE `float_bug` (
  `v` FLOAT NOT NULL
) ENGINE=INNODB DEFAULT CHARSET=utf8;


INSERT INTO float_bug VALUES(92160596);


SELECT * FROM float_bug;


Returns 92160600.

Then I tried these:

SELECT * FROM float_bug WHERE v = 92160596;
SELECT * FROM float_bug WHERE v BETWEEN 92160596 AND 92160600;


Both return nothing!

However this

SELECT * FROM float_bug WHERE v = 92160592;


Returns 92160600.

I'm ready to throw my computer into the wall, but unfortunately that won't help because I have exactly the same behaviour on my remote server and I can't throw it into the wall physically.

Any ideas what is going on here?
This is not just a SQL thing: floating-point numbers should always be considered approximations in any language. See https://floating-point-gui.de/ amongst other references.

You can use the DOUBLE type instead which would help, as that can represent integers up to 53 bits in length accurately, but you would have problems later with bigger numbers.

Unless you absolutely must have floating-point numbers, these types should be avoided. Use integer (int, bigint, ...) or fixed-point types (decimal, numeric) instead. As you don't say what you are using these numbers to represent we can't make a more specific recommendation.