Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Won't Fix
-
5.5.30
-
None
-
None
-
Debian Wheezy
Description
GREATEST/LEAST functions behaves differently than in MySQL 5.5
mysql> SELECT GREATEST(2, 1.11);
|
+-------------------+
|
| GREATEST(2, 1.11) |
|
+-------------------+
|
| 2 |
|
+-------------------+
|
1 row in set (0.00 sec)
|
|
MariaDB [test]> SELECT GREATEST(2, 1.11);
|
+-------------------+
|
| GREATEST(2, 1.11) |
|
+-------------------+
|
| 2.00 |
|
+-------------------+
|
1 row in set (0.00 sec)
|
Happens also on datetime type where microseconds appear.
mysql> SELECT GREATEST('2015-01-01 00:00:00', NOW());
|
+----------------------------------------+
|
| GREATEST('2015-01-01 00:00:00', NOW()) |
|
+----------------------------------------+
|
| 2015-01-01 00:00:00 |
|
+----------------------------------------+
|
1 row in set (0.00 sec)
|
|
MariaDB [test]> SELECT GREATEST('2015-01-01 00:00:00', NOW());
|
+----------------------------------------+
|
| GREATEST('2015-01-01 00:00:00', NOW()) |
|
+----------------------------------------+
|
| 2015-01-01 00:00:00.000000 |
|
+----------------------------------------+
|
1 row in set (0.00 sec)
|
If this is desired behavior it should be mentioned in "MariaDB versus MySQL - Compatibility".
However - from users point of view - such behavior is very counterintuitive, one expects the same value and precision as in passed value, not extended to maximum precision of all passed params.