I compiled and installed MySQL 3.22.32 on RadHat 7.0 and I am having some strange 
behavior when it comes to double datatype fields.  Please see the examples below. I 
have the exact same version loaded on RedHat 6.2 and it works fine. What gives?

Here is the table and the data in it

mysql> SELECT * FROM LookWeight;

+---------+---------+------------+
| LWeight | LowW    | HighW      |
+---------+---------+------------+
|       1 |  0.0000 |     1.0000 |
|       2 |  1.0000 |     2.0000 |
|       3 |  2.0000 |     3.0000 |
|       4 |  3.0000 |     4.0000 |
|       5 |  4.0000 |     5.0000 |
|       6 |  5.0000 |     6.0000 |
|       7 |  6.0000 |     7.0000 |
|       8 |  7.0000 |     8.0000 |
|       9 |  8.0000 |     9.0000 |
|      10 |  9.0000 |    10.0000 |
|      11 | 10.0000 | 10000.0000 |
+---------+---------+------------+
11 rows in set (0.00 sec)

Run this and all works fine

mysql> SELECT * FROM LookWeight WHERE LWeight < 5;
+---------+--------+--------+
| LWeight | LowW   | HighW  |
+---------+--------+--------+
|       1 | 0.0000 | 1.0000 |
|       2 | 1.0000 | 2.0000 |
|       3 | 2.0000 | 3.0000 |
|       4 | 3.0000 | 4.0000 |
+---------+--------+--------+
4 rows in set (0.00 sec)

Now I run this

mysql> SELECT * FROM LookWeight WHERE LowW < 5;
+---------+---------+------------+
| LWeight | LowW    | HighW      |
+---------+---------+------------+
|       1 |  0.0000 |     1.0000 |
|       2 |  1.0000 |     2.0000 |
|       3 |  2.0000 |     3.0000 |
|       4 |  3.0000 |     4.0000 |
|       5 |  4.0000 |     5.0000 |
|       6 |  5.0000 |     6.0000 |
|       7 |  6.0000 |     7.0000 |
|       8 |  7.0000 |     8.0000 |
|       9 |  8.0000 |     9.0000 |
|      10 |  9.0000 |    10.0000 |
|      11 | 10.0000 | 10000.0000 |
+---------+---------+------------+
11 rows in set (0.01 sec)

Here is the tables definition

mysql> DESCRIBE LookWeight;
+---------+--------------+------+-----+---------+----------------+
| Field   | Type         | Null | Key | Default | Extra          |
+---------+--------------+------+-----+---------+----------------+
| LWeight | int(11)      |      | PRI | 0       | auto_increment |
| LowW    | double(16,4) | YES  |     | NULL    |                |
| HighW   | double(16,4) | YES  |     | NULL    |                |
+---------+--------------+------+-----+---------+----------------+
3 rows in set (0.00 sec)

Reply via email to