Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL error when hard deleting a volume with a folder structure more than 15 levels deep #8073

Closed
angrybrad opened this issue Jun 16, 2021 · 0 comments
Assignees
Labels
assets 📁 features related to asset management enhancement improvements to existing features

Comments

@angrybrad
Copy link
Member

Description

https://dev.mysql.com/doc/refman/8.0/en/ansi-diff-foreign-keys.html

Cascading operations may not be nested more than 15 levels deep.

MySQL won't cascade delete/update more than 15 levels deep on foreign keys.

Where this tends to be a problem on the database side is on tables with hierarchy (parentId/childId) columns and can manifest itself with this error:

SQLSTATE[HY000]: General error: 1296 Got error 193

In Craft, this isn't a problem for structure sections, because when deleting, we start at the edge and recursively walk backward in code to perform the deletes.

But it can be an issue when deleting a volume with a deeply nested folder structure. We should perform the same logic we do for structure sections to volumes to work around this.

@angrybrad angrybrad added the enhancement improvements to existing features label Jun 16, 2021
@brandonkelly brandonkelly added the assets 📁 features related to asset management label Jun 16, 2021
@brandonkelly brandonkelly added this to the 3.7 milestone Jun 16, 2021
andris-sevcenko pushed a commit that referenced this issue Jun 17, 2021
@craftcms craftcms locked and limited conversation to collaborators Jun 22, 2021
andris-sevcenko pushed a commit that referenced this issue Jul 13, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
assets 📁 features related to asset management enhancement improvements to existing features
Projects
None yet
Development

No branches or pull requests

3 participants