Bug #109323 Request for raising warning when unsupported storage engine passed STORAGE claus
Submitted: 9 Dec 2022 3:06 Modified: 9 Dec 2022 4:38
Reporter: Tsubasa Tanaka (OCA) Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: DDL Severity:S4 (Feature request)
Version:8.0.31 OS:CentOS (7.9)
Assigned to: CPU Architecture:x86

[9 Dec 2022 3:06] Tsubasa Tanaka
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.


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)
[9 Dec 2022 4:38] MySQL Verification Team
Hello tanaka-San,

Thank you for the feature request!