Bug #109317 Syntax error about storage-type option in CREATE TABLE statement
Submitted: 8 Dec 2022 9:37 Modified: 12 Dec 2022 23:49
Reporter: Tomoaki Otsuka Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.7, 8.0 OS:Any
Assigned to: Jon Stephens CPU Architecture:Any

[8 Dec 2022 9:37] Tomoaki Otsuka
Description:
According to CREATE TABLE syntax in a document(https://dev.mysql.com/doc/refman/8.0/en/create-table.html), one of the table_option syntax is defined as "| TABLESPACE tablespace_name [STORAGE {DISK | MEMORY}]", but it seems to be wrong.

"TABLESPACE tablespace_name" and "STORAGE {DISK | MEMORY}" are independent.
Please check sql_yacc.yy (https://github.com/mysql/mysql-server/blob/8.0/sql/sql_yacc.yy#L6812)

How to repeat:
Please check https://github.com/mysql/mysql-server/blob/8.0/sql/sql_yacc.yy#L6812.

Also, create table is possible with "storage memory(or disk)" option like,
`CREATE TABLE t1 (id int) storage memory;`

Suggested fix:
table_option definition in CREATE TABLE syntax is not 

```
table_option: {
    AUTOEXTEND_SIZE [=] value
  | AUTO_INCREMENT [=] value
...
  | TABLESPACE tablespace_name [STORAGE {DISK | MEMORY}]
...
```

suggested fix is 

```
table_option: {
    AUTOEXTEND_SIZE [=] value
  | AUTO_INCREMENT [=] value
...
  | TABLESPACE tablespace_name 
  | STORAGE {DISK | MEMORY}
...
```
[8 Dec 2022 10:29] MySQL Verification Team
Hello 知亮 大塚,

Thank you for the report and feedback.

regards,
Umesh
[12 Dec 2022 23:49] Jon Stephens
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly.