Bug #91681 Unable to drop, update schema
Submitted: 17 Jul 2018 18:38 Modified: 22 Oct 2018 12:12
Reporter: Benjamin Stone Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:8.0.11 OS:MacOS
Assigned to: CPU Architecture:Any
Tags: 3664, drop schema, SDI

[17 Jul 2018 18:38] Benjamin Stone
Description:
When I go to update a schema from a (using import from self-contained file) database dump I get the following error:

ERROR 3664 (HY000) at line 25: Failed to set SDI 'F.users' in tablespace 'f/users'.

I use a workaround of creating a new schema to import the dump into.

However, when I go to delete the old schema, I get the same error. 
Error Code: 3664. Failed to set SDI 'ForagerCurrent.cart_products' in tablespace 'foragercurrent/cart_products'.

Please advise

How to repeat:
When I go to update a schema from a (using import from self-contained file) database dump I get the following error:

ERROR 3664 (HY000) at line 25: Failed to set SDI 'F.users' in tablespace 'f/users'.

I use a workaround of creating a new schema to import the dump into.

However, when I go to delete the old schema, I get the same error. 
Error Code: 3664. Failed to set SDI 'ForagerCurrent.cart_products' in tablespace 'foragercurrent/cart_products'.

Please advise
[18 Jul 2018 7:21] MySQL Verification Team
Hello Benjamin,

Thank you for the report.
Could you please provide self-contained file which demonstrate this issue? Thank you!

If the data you need to attach is more than 3MB, you should create a compressed archive of the data and a README file that describes the data with a filename that includes the bug number (recommended filename: mysql-bug-data-91681.zip) and upload one to sftp.oracle.com. Your Oracle Web account (ben@goforager.com) and a client that supports SFTP are required in order to access the SFTP server.

To upload the file to sftp.oracle.com:

Open an SFTP client and connect to sftp.oracle.com. Specify port 2021 and remote directory /support/incoming/.
Log in with your username (ben@goforager.com) and password.
Upload the archive to /support/incoming.
Once you have uploaded the file, add a comment to this bug to notify us about it.
Example: sftp -oPort=2021 -oUser=ben@goforager.com sftp.oracle.com:/support/incoming
Usage Notes: This directory is unlistable, which means that once you have uploaded your file, you will not be able to see it. A file cannot be uploaded more than once with the same filename. The filename must be changed before attempting to upload the file again. The filename should always start with mysql-bug- prefix. Files are retained on the SFTP server for 7 days and then permanently removed.

Thanks,
Umesh
[22 Oct 2018 12:12] MySQL Verification Team
Hi,

Your problem is actually quite simple. Whether you create a schema or remove it, you have to take care of the foreign keys. You have to know the graph of the relationships and create the master table first and the table that is last in dependency graph should be created at the end. With dropping it goes the other way around.

This is fully described in our Reference Manual.