Description:
This is feature request.
---
Document describes STORAGE table option is only for NDB.
> The STORAGE table option is employed only with NDB tables. STORAGE determines the type of storage used (disk or memory), and can be either DISK or MEMORY.
https://dev.mysql.com/doc/refman/8.0/en/create-table.html
But even if CREATE TABLE with STORAGE clause for InnoDB, there's no warning and error.
I request to raise warning when STORAGE clause to unsupported storage engines.
How to repeat:
mysql80 226> CREATE TABLE t2 (num int) STORAGE memory;
Query OK, 0 rows affected (0.03 sec)
mysql80 226> SHOW CREATE TABLE t2\G
*************************** 1. row ***************************
Table: t2
Create Table: CREATE TABLE `t2` (
`num` int DEFAULT NULL
) /*!50100 STORAGE MEMORY */ ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_ja_0900_as_cs
1 row in set (0.01 sec)
Suggested fix:
Raise warning like the time when specify KEY USING HASH for InnoDB.
mysql80 7> CREATE TABLE t3 (num int, KEY(num) USING HASH);
Query OK, 0 rows affected, 1 warning (0.03 sec)
mysql80 7> SHOW WARNINGS;
+-------+------+---------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+-------+------+---------------------------------------------------------------------------------------------------------+
| Note | 3502 | This storage engine does not support the HASH index algorithm, storage engine default was used instead. |
+-------+------+---------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)