Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Fix dropping foreign key multiple times with test #210

Closed
wants to merge 63 commits into from
Sergi de Pablos

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

and others added some commits
Benjamin Eberlei Fix Version 659de9a
Christophe Coevoet Used the placeholder in the command help for the name 3d426e5
AduroIdea bindParam function expects length parameter for oci_bind_by_name oci8
driver function
134c9f4
AduroIdea Revert "bindParam function expects length parameter for oci_bind_by_n…
…ame oci8"

This reverts commit 17a265d.
125e053
AduroIdea Fixed error with ORA-03131 in oracle stored procedures
bindParam function expects length parameter for oci_bind_by_name oci8
203d037
AduroIdea Added $length parameter to Driver/Statement interface so it follows
previous changes in bindparam function
1bdd564
AduroIdea Fixed bindParam function so it implements interface 7ab6bbe
Benjamin Eberlei Bump common b75d863
Benjamin Eberlei Merge branch 'DBAL-301' into 2.3 f4f92ae
Benjamin Eberlei Merge remote-tracking branch 'origin/2.3' into 2.3 1e1cdb7
Benjamin Eberlei [DBAL-298] Fix foreign table names not being quoted correctly. 7a73a5a
Benjamin Eberlei Merge branch 'DBAL-298' into 2.3 39e0f2f
Johannes improved exception messages when driver error occurs f94e777
Johannes added before/after example 0612995
Benjamin Eberlei Merge branch 'ImproveExceptions' into 2.3 b8f01c2
Benjamin Eberlei Bump Common b0ededc
Benjamin Eberlei Bump dev version to 2.3.0 86b10e7
Benjamin Eberlei Release 2.3.0-RC1 a2da6c6
Albert Casademont 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
Alexander Merge branch 'fix-mysql-unsigned' into 2.3 4a3830f
Christophe Coevoet Added a missing method in the Constraint interface 4973d47
Alexander Merge branch 'missing_method' into 2.3 73beb2f
Christophe Coevoet Fixed some phpdoc fd45267
Christophe Coevoet fixed more phpdoc and CS in the platforms 8e4b15f
Alexander Merge branch 'fix_phpdoc' into 2.3 6470e20
Guilherme Blanco Added missing MySQL data type: set. 1ed30bd
Benjamin Eberlei Merge remote-tracking branch 'origin/2.3' into 2.3 f7678be
Martin D'Aloia 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
Fabio B. Silva fix DDC-1978 26bb6ed
Benjamin Eberlei Release 2.3.0-RC2 375506d
Benjamin Eberlei Bump dev version to 2.3.0 adb28e4
Benjamin Eberlei Merge remote-tracking branch 'origin/2.3' into 2.3 a880baf
Christophe Coevoet Fixed a typo in a method name 29f29d8
Benjamin Eberlei Merge branch 'DBAL-338' into 2.3 7a657fa
Benjamin Eberlei [DBAL-339] Prevent PDO API failure in setFetchMode() 2c10252
Benjamin Eberlei Merge branch 'DBAL-339' into 2.3 db9b032
Padraig O'Sullivan Use dropAndCreateDatabase schema manager function in test initializat…
…ion instead of individual versions of each.
0019d0b
Padraig O'Sullivan 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
Padraig O'Sullivan Remove un-needed require_once directive. 0251d10
Padraig O'Sullivan Update fix for issue with bigint type to work for both postgresql and…
… mysql.
5308f08
Padraig O'Sullivan Simplify fix for test issue with bigint type. 2d1d397
Benjamin Eberlei Merge branch 'DBAL-194' into 2.3 b2f67c1
Benjamin Eberlei Bump dev version to 2.3.0 239630b
Benjamin Eberlei Release 2.3.0-RC3 52675eb
Vladan 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
Vladan Fixed the MySQL tests 1c4f7f2
Benjamin Eberlei Merge branch 'DBAL-342' into 2.3 807a4a8
Benjamin Eberlei Update UPGRADE document 8136c29
Christian 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
Benjamin Eberlei Update UPGRADE 0d5ed06
Benjamin Eberlei Merge branch 'DBAL-2013' into 2.3 c00cfd4
Benjamin Eberlei [DBAL-335] Fix nasty bug in MasterSlaveConnection, connecting and wri…
…ting to slave when using keepSlave option.
c5658ba
Benjamin Eberlei Merge branch 'DBAL-335' into 2.3 62cb965
Benjamin Eberlei Update Common dependency 26b60db
Benjamin Eberlei Release 2.3.0-RC3 3887fe0
Benjamin Eberlei Bump dev version to 2.3.0 77ada96
Benjamin Eberlei Release 2.3.0-RC4 f760aa4
Benjamin Eberlei Bump dev version to 2.3.0 c4fe349
Benjamin Eberlei Fix broken test d047141
Benjamin Eberlei Adjusted common version cf16eef
Benjamin Eberlei Bump dev version to 2.3.1 fdc866a
Benjamin Eberlei Release 2.3.0 30dc433
Sergi de Pablos 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
Collaborator

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

Sergi de Pablos sdepablos closed this
Sergi de Pablos

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

Showing 63 unique commits by 13 authors.

Jul 16, 2012
Benjamin Eberlei Fix Version 659de9a
Jul 24, 2012
Christophe Coevoet Used the placeholder in the command help for the name 3d426e5
Jul 29, 2012
AduroIdea bindParam function expects length parameter for oci_bind_by_name oci8
driver function
134c9f4
AduroIdea Revert "bindParam function expects length parameter for oci_bind_by_n…
…ame oci8"

This reverts commit 17a265d.
125e053
AduroIdea Fixed error with ORA-03131 in oracle stored procedures
bindParam function expects length parameter for oci_bind_by_name oci8
203d037
AduroIdea Added $length parameter to Driver/Statement interface so it follows
previous changes in bindparam function
1bdd564
AduroIdea Fixed bindParam function so it implements interface 7ab6bbe
Benjamin Eberlei Bump common b75d863
Benjamin Eberlei Merge branch 'DBAL-301' into 2.3 f4f92ae
Benjamin Eberlei Merge remote-tracking branch 'origin/2.3' into 2.3 1e1cdb7
Benjamin Eberlei [DBAL-298] Fix foreign table names not being quoted correctly. 7a73a5a
Benjamin Eberlei Merge branch 'DBAL-298' into 2.3 39e0f2f
Johannes improved exception messages when driver error occurs f94e777
Johannes added before/after example 0612995
Benjamin Eberlei Merge branch 'ImproveExceptions' into 2.3 b8f01c2
Benjamin Eberlei Bump Common b0ededc
Benjamin Eberlei Release 2.3.0-RC1 a2da6c6
Benjamin Eberlei Bump dev version to 2.3.0 86b10e7
Aug 14, 2012
Albert Casademont 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
Alexander Merge branch 'fix-mysql-unsigned' into 2.3 4a3830f
Christophe Coevoet Added a missing method in the Constraint interface 4973d47
Alexander Merge branch 'missing_method' into 2.3 73beb2f
Christophe Coevoet Fixed some phpdoc fd45267
Christophe Coevoet fixed more phpdoc and CS in the platforms 8e4b15f
Alexander Merge branch 'fix_phpdoc' into 2.3 6470e20
Aug 29, 2012
Guilherme Blanco Added missing MySQL data type: set. 1ed30bd
Benjamin Eberlei Merge remote-tracking branch 'origin/2.3' into 2.3 f7678be
Martin D'Aloia 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
Fabio B. Silva fix DDC-1978 26bb6ed
Benjamin Eberlei Release 2.3.0-RC2 375506d
Benjamin Eberlei Bump dev version to 2.3.0 adb28e4
Sep 05, 2012
Benjamin Eberlei Merge remote-tracking branch 'origin/2.3' into 2.3 a880baf
Christophe Coevoet Fixed a typo in a method name 29f29d8
Benjamin Eberlei Merge branch 'DBAL-338' into 2.3 7a657fa
Benjamin Eberlei [DBAL-339] Prevent PDO API failure in setFetchMode() 2c10252
Benjamin Eberlei Merge branch 'DBAL-339' into 2.3 db9b032
Padraig O'Sullivan Use dropAndCreateDatabase schema manager function in test initializat…
…ion instead of individual versions of each.
0019d0b
Padraig O'Sullivan 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
Padraig O'Sullivan Remove un-needed require_once directive. 0251d10
Padraig O'Sullivan Update fix for issue with bigint type to work for both postgresql and…
… mysql.
5308f08
Padraig O'Sullivan Simplify fix for test issue with bigint type. 2d1d397
Benjamin Eberlei Merge branch 'DBAL-194' into 2.3 b2f67c1
Benjamin Eberlei Release 2.3.0-RC3 52675eb
Benjamin Eberlei Bump dev version to 2.3.0 239630b
Sep 17, 2012
Vladan 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
Vladan Fixed the MySQL tests 1c4f7f2
Benjamin Eberlei Merge branch 'DBAL-342' into 2.3 807a4a8
Benjamin Eberlei Update UPGRADE document 8136c29
Christian 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
Benjamin Eberlei Update UPGRADE 0d5ed06
Benjamin Eberlei Merge branch 'DBAL-2013' into 2.3 c00cfd4
Benjamin Eberlei [DBAL-335] Fix nasty bug in MasterSlaveConnection, connecting and wri…
…ting to slave when using keepSlave option.
c5658ba
Benjamin Eberlei Merge branch 'DBAL-335' into 2.3 62cb965
Benjamin Eberlei Update Common dependency 26b60db
Benjamin Eberlei Release 2.3.0-RC3 3887fe0
Benjamin Eberlei Bump dev version to 2.3.0 77ada96
Benjamin Eberlei Release 2.3.0-RC4 f760aa4
Benjamin Eberlei Bump dev version to 2.3.0 c4fe349
Sep 20, 2012
Benjamin Eberlei Fix broken test d047141
Benjamin Eberlei Adjusted common version cf16eef
Benjamin Eberlei Release 2.3.0 30dc433
Benjamin Eberlei Bump dev version to 2.3.1 fdc866a
Oct 04, 2012
Sergi de Pablos 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
Something went wrong with that request. Please try again.