-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
Quote table names that also are reserved keywords #334
Merged
greg0ire
merged 1 commit into
doctrine:1.4.x
from
stephen-lewis:bugfix/quote_reserved_table_names_in_purger_delete_mode
Jan 13, 2020
Merged
Quote table names that also are reserved keywords #334
greg0ire
merged 1 commit into
doctrine:1.4.x
from
stephen-lewis:bugfix/quote_reserved_table_names_in_purger_delete_mode
Jan 13, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment has been minimized.
This comment has been minimized.
greg0ire
reviewed
Jan 4, 2020
greg0ire
reviewed
Jan 4, 2020
greg0ire
reviewed
Jan 4, 2020
greg0ire
reviewed
Jan 4, 2020
tests/Doctrine/Tests/Common/DataFixtures/Purger/ORMPurgerTest.php
Outdated
Show resolved
Hide resolved
#333 is not merged up yet, hence why the build is not fixed. Are you sure you should target master though? Is there a BC-break in your PR? EDIT it's a patch so I guess/hope not, let's retarget |
greg0ire
force-pushed
the
bugfix/quote_reserved_table_names_in_purger_delete_mode
branch
2 times, most recently
from
January 4, 2020 16:11
cd113d0
to
25a09a8
Compare
Essentially, purging the database in DELETE mode prior to fixture load fails if any fixture entities use tables names with reserved words (e.g. 'User' in Postgres, or in the test case 'Group' in sqlite). The change makes ORMPurger->getTableName() use the same method as AbstractPlatform::getTruncateTableSQL() uses to get the table name (quoted as necessary). Test case uses sqlite reserved word 'Group' as an example and checks returned table name is quoted correctly.
greg0ire
force-pushed
the
bugfix/quote_reserved_table_names_in_purger_delete_mode
branch
from
January 4, 2020 16:14
25a09a8
to
7f309a2
Compare
greg0ire
approved these changes
Jan 4, 2020
greg0ire
changed the title
[ORMPurger] Tables with reserved word names are now quoted automatica…
Quote table names that also are reserved keywords
Jan 4, 2020
SenseException
approved these changes
Jan 12, 2020
stephen-lewis
deleted the
bugfix/quote_reserved_table_names_in_purger_delete_mode
branch
January 15, 2020 19:20
This was referenced Jan 15, 2020
stephen-lewis
added a commit
to stephen-lewis/data-fixtures
that referenced
this pull request
Jan 17, 2020
Change in 1.4.1 (doctrine#334) caused ORMPurger to generate quotes inside table names with mocked schemas leaving them invalid (e.g. test_schema__"group") becuase quoting strategy was ignored. Reverted changes to ORMPurger::getTableName and added new fucntion to mimic behaviour of SchemaTool in doctrine/orm when generating delete purge SQL. Unit tests included to check for correct SQL generation for tables both with and without schema. Fixes doctrine#338.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Technically a duplicate of PR #292 but with tests included.
Essentially, purging the database in DELETE mode prior to fixture load fails if any fixture entities use tables names with reserved words (e.g. 'User' in Postgres, or in the test case 'Group' in sqlite). The change makes ORMPurger->getTableName() use the same method as AbstractPlatform::getTruncateTableSQL() uses to get the table name (quoted as necessary).
Test case uses sqlite reserved word 'Group' as an example and checks returned table name is quoted correctly.
Closes #292