I got this idea from a Valerii Kravchuk’s MySQL bug report:
In theory, I completely agree that MySQL and forks should not allow us to set a default storage engine which cannot be used to create a table. You can see the same with MariaDB’s
SEQUENCE. The MySQL & forks philosophy seems to be: ignore your mistakes, so you can repeat them forever. Which can turn a mistype into a major data loss.
Unless you only use InnoDB and your magic powers tell you that this will never change, the
ENGINE clause should be mandatory in your MySQL installation. Since there is no clean way to make it mandatory, setting a “weird” storage engine as default seems to be a decent workaround. I don’t like it, but it can prevent human mistakes.
MariaDB [test]> SET SESSION default_storage_engine = 'performance_schema'; Query OK, 0 rows affected (0.00 sec) MariaDB [test]> CREATE TABLE x (id INT) ; ERROR 1005 (HY000): Can't create table `test`.`x` (errno: 131 "Command not supported by database") Error (Code 1005): Can't create table `test`.`x` (errno: 131 "Command not supported by database") Error (Code 1683): Invalid performance_schema usage.