Bug #85437 Not allowed to drop tablespace without associated files
Submitted: 14 Mar 2017 9:24 Modified: 20 Mar 2017 15:08
Reporter: Magnus Blåudd Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Data Dictionary Severity:S2 (Serious)
Version:8.0.1 OS:Any
Assigned to: CPU Architecture:Any

[14 Mar 2017 9:24] Magnus Blåudd
Dropping a tablespace without associated files will fail with an error saying "error: 3506  message: 'tablespaces dictionary object is invalid. (No files associated with this tablespace.)'", thus causing the DD to get out of sync with the SE since the validation which set this error occurs after the tablespace already has been successfully dropped from the SE. 

It's maybe peculiar to drop a tablespace without any associated files but it seems like NDB does not allow dropping tablespace _with_ andy associated files. Testing with earlier versions also show that it is allowed to drop a tablespace without associated files.

How to repeat:
This wass found when testing tablespaces in NDB. Basic test for tablespaces in NDB has been added to ndbcluster.tablespace_basic.test and the commands there which intendd to drop the created objects now fails in mysql-trunk while it worked in earlier versions.

Suggested fix:
1. Perform validation (also) before dropping the tablespace from SE
2. Allow tablespace to be dropped even without associated files.
[20 Mar 2017 15:08] Daniel Price
Posted by developer:
Fixed as of the upcoming 8.0.2 release, and here's the changelog entry:

Dropping a tablespace without that associated tablepace file failed with
an error stating that the tablespace dictionary object is invalid.