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
DDC-214: schema-tool --complete-update throw PDOException on DROP INDEX #2828
Comments
Comment created by rickdt: I take the index definition from DBAL/Schema/Comparator:207
|
Comment created by @beberlei: Which database platform is this happening on? |
Comment created by rickdt: mysql |
Comment created by @beberlei: Ok so Mysql creates an index for each foreign key implicitly which is then queryable explicitly. To fix this the schema comparator "FixSchema" visitor accompanies for that for the MySQL Platform. Do you use your own platform maybe? |
Comment created by @beberlei: You could really help me if you could paste the serialized object code for both schema instances for your use-case or a reproduce case. |
Comment created by rickdt: Here are the serialized schema you required. |
Comment created by rickdt: I only use Doctrine basic feature, no custom platform. |
Comment created by rickdt: Can I do anything to help you resolve this issue. This is really a big annoyance not being able to update existing database. |
Comment created by rickdt: Attached a test case Doctrine/Tests/ORM/Functional/Ticket/DDC214Test |
Comment created by rickdt: The test case must be run using mysql. |
Comment created by @beberlei: hah thats an awesome-ly simple test-case. thank you very much :-) |
Comment created by @beberlei: Yes, i found the issue - however the test-case will not work with me requiring it to have 0 change sqls - there is another bug that is related to not null and default values. |
Comment created by rickdt: I did not really intend to do a "clean" unit test. I just wanted allow you reproduce the problem. Good news you have been able to reproduce the issue. And again, your great work is really appreciated! |
Comment created by @beberlei: This and many more issues have been fixed. |
Issue was closed with resolution "Fixed" |
Comment created by rickdt: This is VERY VERY VERY Great!!! I experienced serious perfomance issue with the query (getListTableForeignKeysSql) :
I think this is a bug in mysql server (5.1.37-1ubuntu5). I changed the query a little bit and it work great :
|
Comment created by @beberlei: Patched, and speedy again! Thank you very much. |
Comment created by rickdt: That was fast! |
Comment created by @jwage: The test for this issue is failing for me under mysql.
Any ideas? |
Comment created by romanb: Seems to fail under postgres, too. |
Imported 1 attachments from Jira into https://gist.github.com/547fce46a528d6137bc7 |
Jira issue originally created by user rickdt:
Here is the stack trace
I think the problem is in the Schema Comparator. It generate a DROP for a foreign key index.
If you compare the index definition from database and from metadata you will see that the foreign key index is present only in the definition obtained from database.
Database :
From metadata :
The text was updated successfully, but these errors were encountered: