Description:
The time type results are inconsistent when requesting a query with or without group by.
How to repeat:
mysql> CREATE TABLE test_table1 (
id bigint(20) NOT NULL,
int_test int(11) DEFAULT NULL,
PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
mysql> INSERT INTO test_table1 values(1, 24);
mysql> INSERT INTO test_table1 values(2, 30);
mysql> select id, int_test/7, maketime(int_test-12, int_test%4, int_test/7) as col1 from test_table1;
+----+------------+---------------+
| id | int_test/7 | col1 |
+----+------------+---------------+
| 1 | 3.4286 | 12:00:03.4285 |
| 2 | 4.2857 | 18:02:04.2857 |
+----+------------+---------------+
2 rows in set (0.00 sec)
mysql> select maketime(int_test-12, int_test%4, int_test/7) as col1 from test_table1 group by col1;
+---------------+
| col1 |
+---------------+
| 12:00:03.4286 |
| 18:02:04.2857 |
+---------------+
2 rows in set (0.00 sec)
Description: The time type results are inconsistent when requesting a query with or without group by. How to repeat: mysql> CREATE TABLE test_table1 ( id bigint(20) NOT NULL, int_test int(11) DEFAULT NULL, PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; mysql> INSERT INTO test_table1 values(1, 24); mysql> INSERT INTO test_table1 values(2, 30); mysql> select id, int_test/7, maketime(int_test-12, int_test%4, int_test/7) as col1 from test_table1; +----+------------+---------------+ | id | int_test/7 | col1 | +----+------------+---------------+ | 1 | 3.4286 | 12:00:03.4285 | | 2 | 4.2857 | 18:02:04.2857 | +----+------------+---------------+ 2 rows in set (0.00 sec) mysql> select maketime(int_test-12, int_test%4, int_test/7) as col1 from test_table1 group by col1; +---------------+ | col1 | +---------------+ | 12:00:03.4286 | | 18:02:04.2857 | +---------------+ 2 rows in set (0.00 sec)