Ticket #1372 (closed defect: fixed)
Doctrine_Export::exportSortedClassesSql() does not build an array of unique queries
| Reported by: | subzero2000 | Owned by: | subzero2000 |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | Import/Export | Version: | 1.0.0 |
| Severity: | Keywords: | ||
| Cc: | Has Test: | yes | |
| Status: | Pending Core Response | Has Patch: | yes |
Description
The array of queries that is built up by Doctrine_Export::exportSortedClassesSql() is not passed through array_unique() after it is built. It has been noticed that at least with column aggregation inheritance, this means that both the parent and any child classes will generate multiple CREATE TABLE statements for the same table. These statements are handled inside a transaction, and it has been noticed that MySQL will create the table on the first statement and complain about table already exists on subsequent statements (which inside a transaction it should NOT do), but PostgreSQL (and presumably other RDBMS) does the right thing and rolls back the entire transaction and does not create the table.
Attached is a patch that fixes this in the 1.0 branch.
jwage, I am assigning this issue to you so you can review the attached patch. I will be happy to apply it if it meets with your approval if you lack the time to do so. I believe I still have commit privileges.
I also noticed that while doing an svn diff of this file, it was evidently committed after being edited on a Windows machine, as it contains carriage returns on every line (shows up as M in vim). I left that alone, and made only the necessary changes.