Fix dropping foreign key multiple times with test #210

Closed
wants to merge 63 commits into
from

Projects

None yet
@sdepablos
Contributor

In some cases the Comparator class returns multiple drops for the same foreign key.
Specifically, in case you have two tables, A & B, with A having a foreign key FK
referencing B, if you drop table B, the resulting diff shows this FK twice,
once on the diff->orphanedForeignKeys array as we're deleting B, and another on
the diff->changedTables array as table A is also being modified. As a result of this you
get the DROP FOREIGN KEY instruction twice in the final SQL.

I'm not really sure if this change should be done in Comparator or if it's better to receive the full diff, even with duplicated drops for FK and later, when generating the final SQL, dropping the unnecesary ones

beberlei and others added some commits Jul 16, 2012
@beberlei beberlei Fix Version 659de9a
@stof @beberlei stof Used the placeholder in the command help for the name 3d426e5
@beberlei ivan bindParam function expects length parameter for oci_bind_by_name oci8
driver function
134c9f4
@beberlei ivan Revert "bindParam function expects length parameter for oci_bind_by_n…
…ame oci8"

This reverts commit 17a265d.
125e053
@beberlei ivan Fixed error with ORA-03131 in oracle stored procedures
bindParam function expects length parameter for oci_bind_by_name oci8
203d037
@beberlei ivan Added $length parameter to Driver/Statement interface so it follows
previous changes in bindparam function
1bdd564
@beberlei ivan Fixed bindParam function so it implements interface 7ab6bbe
@beberlei beberlei Bump common b75d863
@beberlei beberlei Merge branch 'DBAL-301' into 2.3 f4f92ae
@beberlei beberlei Merge remote-tracking branch 'origin/2.3' into 2.3 1e1cdb7
@beberlei beberlei [DBAL-298] Fix foreign table names not being quoted correctly. 7a73a5a
@beberlei beberlei Merge branch 'DBAL-298' into 2.3 39e0f2f
@schmittjoh @beberlei schmittjoh improved exception messages when driver error occurs f94e777
@schmittjoh @beberlei schmittjoh added before/after example 0612995
@beberlei beberlei Merge branch 'ImproveExceptions' into 2.3 b8f01c2
@beberlei beberlei Bump Common b0ededc
@beberlei beberlei Release 2.3.0-RC1 a2da6c6
@beberlei beberlei Bump dev version to 2.3.0 86b10e7
@acasademont @asm89 acasademont Fix unsigned columns in MySql
Unsigned column properties were never set. In consequence all migrations diff were trying to change the column definition when it was already changed.
c65c269
@asm89 asm89 Merge branch 'fix-mysql-unsigned' into 2.3 4a3830f
@stof @asm89 stof Added a missing method in the Constraint interface 4973d47
@asm89 asm89 Merge branch 'missing_method' into 2.3 73beb2f
@stof @asm89 stof Fixed some phpdoc fd45267
@stof @asm89 stof fixed more phpdoc and CS in the platforms 8e4b15f
@asm89 asm89 Merge branch 'fix_phpdoc' into 2.3 6470e20
@guilhermeblanco @beberlei guilhermeblanco Added missing MySQL data type: set. 1ed30bd
@beberlei beberlei Merge remote-tracking branch 'origin/2.3' into 2.3 f7678be
@mdaloia @beberlei mdaloia Changed 'implements' by 'extends' because AbstractSchemaSynchronizer …
…is a class not an interface (and Eclipse PDT shows a warning that say that "The type SQLAzureFederationsSynchronizer must implement the inherited method processSqlSafely, processSql" but those methods are already implemented on AbstractSchemaSynchronizer).
cc7b52e
@FabioBatSilva @beberlei FabioBatSilva fix DDC-1978 26bb6ed
@beberlei beberlei Release 2.3.0-RC2 375506d
@beberlei beberlei Bump dev version to 2.3.0 adb28e4
@beberlei beberlei Merge remote-tracking branch 'origin/2.3' into 2.3 a880baf
@stof @beberlei stof Fixed a typo in a method name 29f29d8
@beberlei beberlei Merge branch 'DBAL-338' into 2.3 7a657fa
@beberlei beberlei [DBAL-339] Prevent PDO API failure in setFetchMode() 2c10252
@beberlei beberlei Merge branch 'DBAL-339' into 2.3 db9b032
@posulliv @beberlei posulliv Use dropAndCreateDatabase schema manager function in test initializat…
…ion instead of individual versions of each.
0019d0b
@posulliv @beberlei posulliv Based on whether we are on 32 or 64 bit platform, postgres will retur…
…n a string or an int for the expected php type of a bigint that is > 32 bits.
533ce4e
@posulliv @beberlei posulliv Remove un-needed require_once directive. 0251d10
@posulliv @beberlei posulliv Update fix for issue with bigint type to work for both postgresql and…
… mysql.
5308f08
@posulliv @beberlei posulliv Simplify fix for test issue with bigint type. 2d1d397
@beberlei beberlei Merge branch 'DBAL-194' into 2.3 b2f67c1
@beberlei beberlei Release 2.3.0-RC3 52675eb
@beberlei beberlei Bump dev version to 2.3.0 239630b
@VladanStef @beberlei VladanStef Changed default MySQL table collation to utf8_unicode_ci
Default table collation changed to `utf8_unicode_ci`, as it handles properly a much wider array of characters (Cyrillic, for example) at a generally negligible cost of performance.
f7d6b1e
@VladanStef @beberlei VladanStef Fixed the MySQL tests 1c4f7f2
@beberlei beberlei Merge branch 'DBAL-342' into 2.3 807a4a8
@beberlei beberlei Update UPGRADE document 8136c29
@leonex-cs1 @beberlei leonex-cs1 Bugfix DDC-2013 - Default Session Value ".," for "NLS_NUMERIC_CHARACT…
…ERS". This is needed because Oracle uses other characters for decimal separation depending on the servers locale
7e3dec8
@beberlei beberlei Update UPGRADE 0d5ed06
@beberlei beberlei Merge branch 'DBAL-2013' into 2.3 c00cfd4
@beberlei beberlei [DBAL-335] Fix nasty bug in MasterSlaveConnection, connecting and wri…
…ting to slave when using keepSlave option.
c5658ba
@beberlei beberlei Merge branch 'DBAL-335' into 2.3 62cb965
@beberlei beberlei Update Common dependency 26b60db
@beberlei beberlei Release 2.3.0-RC3 3887fe0
@beberlei beberlei Bump dev version to 2.3.0 77ada96
@beberlei beberlei Release 2.3.0-RC4 f760aa4
@beberlei beberlei Bump dev version to 2.3.0 c4fe349
@beberlei beberlei Fix broken test d047141
@beberlei beberlei Adjusted common version cf16eef
@beberlei beberlei Release 2.3.0 30dc433
@beberlei beberlei Bump dev version to 2.3.1 fdc866a
@sdepablos sdepablos Fix dropping foreign key multiple times with test
In some cases the Comparator class returns multiple drops for the same foreign key.
Specifically, in case you have two tables, A & B, with A having a foreign key FK
referencing B, if you drop table B, the resulting diff show this FK twice,
once on the diff->orphanedForeignKeys as we're deleting B, and another on
diff->changedTables as table A is being modified. As a result of this you get the
DROP FOREIGN KEY instruction twice in the final SQL.
1642307
@doctrinebot

Hello,

thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link:

http://doctrine-project.org/jira/browse/DBAL-358

@sdepablos sdepablos closed this Oct 4, 2012
@sdepablos
Contributor

Sorry, asked merge against the wrong branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment