Ticket #1372 (closed defect: fixed)

Opened 10 months ago

Last modified 10 months ago

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.

Attachments

branches_1.0.patch (1.0 KB) - added by subzero2000 10 months ago.
Patch to ensure array of unique queries is built when exporting schema to database.

Change History

Changed 10 months ago by subzero2000

Patch to ensure array of unique queries is built when exporting schema to database.

Changed 10 months ago by subzero2000

  • has_test set

Changed 10 months ago by subzero2000

  • status changed from new to assigned
  • owner changed from jwage to subzero2000

Changed 10 months ago by subzero2000

  • status changed from assigned to closed
  • resolution set to fixed

(In [4804]) Ensure unique queries are generated when generating SQL for exporting schema to database. Fixes #1372

Changed 10 months ago by anonymous

  • milestone New deleted

Milestone New deleted

Note: See TracTickets for help on using tickets.