Import the table provided into a MariaDB 5.5 and/or 10.0 instance, ensure your max_heap_table_size and tmp_table_size are 32M or less, and issue these queries:
It returns DUPLICATE KEY errors:
ERROR 1034 (HY000): Duplicate key 1 for record at 583508 against record at 11380
Here is the table structure:
The GROUP BY must be in the query to trigger the error.
Notice that if I increase max_heap_table_size and tmp_table_size (512M seems to work here), then the query runs as expected.
After-thought: With the same tmp/heap table sizes, the query runs fine in MySQL 5.5.37, though the bug looks somewhat similar to this open MySQL bug: