Bug #104768 CREATE TABLESPACE (IF NOT EXISTS)
Submitted: 30 Aug 2021 12:52 Modified: 31 Aug 2021 10:57
Reporter: Ahmed Fahad Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DDL Severity:S4 (Feature request)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: create, Tablespace

[30 Aug 2021 12:52] Ahmed Fahad
Description:
Tablespace does not have option create IF NOT EXISTS like Tables, Functions and Stored Procedures have.

Such as,

CREATE TABLE IF NOT EXISTS 'TableName' ...

But such syntax is not allowed for Tablespace

CREATE TABLESPACE IF NOT EXISTS 'TablesapceName'

How to repeat:

CREATE TABLESPACE 'TablesapceName'
CREATE TABLESPACE 'TablesapceName'

Error Code: 1813. Tablespace 'TablesapceName' exists.

CREATE TABLESPACE IF NOT EXISTS 'TablesapceName'

Error Code: 1064. You have an error in ... syntax to use near 'IF NOT EXISTS 'TablesapceName'' at line 1

Suggested fix:
Allow IF NOT EXISTS feature and it's syntax for Tablespaces

CREATE TABLESPACE IF NOT EXISTS 'TablesapceName'
[31 Aug 2021 10:57] MySQL Verification Team
Hello Ahmed,

Thank you for the feature request.

regards,
Umesh