For MariaDB version 10.1.15, running the following query against a table with duplicate indexes instantly crashes MariaDB:

select distinct example_row from table_crash where example_row in ('a','b');

Here is the schema for table_crash :

CREATE TABLE `table_crash` ( `example_row` varchar(24), KEY `index1` (`example_row`), KEY `index2` (`example_row`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

The same query, run against the same table (but without the duplicate index) does not crash the server:

CREATE TABLE `table_no_crash` ( `example_row` varchar(24), KEY `index1` (`example_row`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

The same query, run against the first table schema (except this time, using MyISAM) does not crash the server:

CREATE TABLE `table_crash` ( `example_row` varchar(24), KEY `index1` (`example_row`), KEY `index2` (`example_row`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

[root@node4 ~]# mysql mariadb_crash_poc Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 10 Server version: 10.1.15-MariaDB MariaDB Server Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [mariadb_crash_poc]> show tables; Empty set (0.00 sec) MariaDB [mariadb_crash_poc]> CREATE TABLE `table_crash` ( -> `example_row` varchar(24), -> KEY `index1` (`example_row`), -> KEY `index2` (`example_row`) -> ) ENGINE=InnoDB DEFAULT CHARSET=utf8; Query OK, 0 rows affected, 1 warning (0.01 sec) MariaDB [mariadb_crash_poc]> CREATE TABLE `table_no_crash` ( -> `example_row` varchar(24), -> KEY `index1` (`example_row`) -> ) ENGINE=InnoDB DEFAULT CHARSET=utf8; Query OK, 0 rows affected (0.01 sec) MariaDB [mariadb_crash_poc]> select distinct example_row from table_crash where example_row in ('a','b'); ERROR 2013 (HY000): Lost connection to MySQL server during query MariaDB [mariadb_crash_poc]> select version(); ERROR 2006 (HY000): MySQL server has gone away No connection. Trying to reconnect... ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111 "Connection refused") ERROR: Can't connect to the server unknown [mariadb_crash_poc]> \! service mysql start Starting mysql (via systemctl): [ OK ] unknown [mariadb_crash_poc]> select distinct example_row from table_no_crash where example_row in ('a','b'); No connection. Trying to reconnect... Connection id: 2 Current database: mariadb_crash_poc Empty set (0.00 sec) MariaDB [mariadb_crash_poc]> select distinct example_row from table_no_crash where example_row in ('a','b'); Empty set (0.00 sec)

When it crashes, it seems to exit with exit code 1, logging absolutely nothing to the mysqld log. I have tested this many times and it is consistently reproducable each time without exception.

I have tested this against 10.1.14 and it does not crash MySQL.

Excerpt from mysqlbug: