Hello!
Consider a table containing a float value, for example this one:
CREATE TABLE `TestTable` (
`MyInt` INT(11) NULL DEFAULT '0',
`MyFloat` FLOAT NULL DEFAULT '0'
)
ENGINE=InnoDB;
which I created in a MariaDB.
A row can be inserted either by an SQL statement or using the GUI, which of course also executes an SQL statement:
INSERT INTO `MyTable`.`TestTable` (`MyInt`, `MyFloat`)
VALUES ('10', '3.14159');
Now, trying to delete this row using the GUI, HeidiSQL displays the error 0 rows deleted were that should be 1
. Almost the same happens when one tries to change a value of this row.
The reason is that HeidiSQL runs an SQL command in the background, which checks two floats for equality, which typically fails:
DELETE FROM `MyTAble`.`TestTable`
WHERE `MyInt`=10 AND `MyFloat`=3.14159 LIMIT 1;
Just to check;
SELECT *, (`MyFloat`-3.14159) AS 'Difference' from `TestTable`;
gives
MyInt MyFloat Difference
10 3.14159 0.00000011840820324238166
I understand that this is a dilemma, but may be there is a solution which can be implemented or is already there? (Note that I mean for editing the database by mouse, not by SQL commands)