DDC-887: Schema tool can throw errno 121 when creating or dropping indexes #1102

Closed
opened 2026-01-22 13:02:20 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Nov 22, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user ccapndave:

When changing the model in such a way that the schema tool tries to create or drop an index which is also a foreign key an error is sometimes thrown like:

[PDOException]
SQLSTATE[HY000]: General error: 1025 Error on rename of '.\mydb#sql-10d8_19' to '.\mydb\auth' (errno: 121)

This seems to be caused by MySQL trying to re-use indexes and I think it depends on exactly what has happened before in this table so I can't give an exact case to reproduce. However, it seems to be InnoDB specific and I'm pretty sure its this bug: http://bugs.mysql.com/bug.php?id=15317

Originally created by @doctrinebot on GitHub (Nov 22, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user ccapndave: When changing the model in such a way that the schema tool tries to create or drop an index which is also a foreign key an error is sometimes thrown like: [PDOException] SQLSTATE[HY000]: General error: 1025 Error on rename of '.\mydb#sql-10d8_19' to '.\mydb\auth' (errno: 121) This seems to be caused by MySQL trying to re-use indexes and I think it depends on exactly what has happened before in this table so I can't give an exact case to reproduce. However, it seems to be InnoDB specific and I'm pretty sure its this bug: http://bugs.mysql.com/bug.php?id=15317
admin added the Bug label 2026-01-22 13:02:20 +01:00
admin closed this issue 2026-01-22 13:02:22 +01:00
Author
Owner

@doctrinebot commented on GitHub (Nov 22, 2010):

Comment created by ccapndave:

Another report of the issue at http://bugs.mysql.com/bug.php?id=14347

@doctrinebot commented on GitHub (Nov 22, 2010): Comment created by ccapndave: Another report of the issue at http://bugs.mysql.com/bug.php?id=14347
Author
Owner

@doctrinebot commented on GitHub (Jun 19, 2011):

Comment created by @beberlei:

Fixed

@doctrinebot commented on GitHub (Jun 19, 2011): Comment created by @beberlei: Fixed
Author
Owner

@doctrinebot commented on GitHub (Jun 19, 2011):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jun 19, 2011): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1102