Skip to content
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

Fix SQL Server "extended property" SQL generation #6353

Merged

Conversation

mvorisek
Copy link
Contributor

@mvorisek mvorisek commented Apr 7, 2024

Q A
Type bug
Fixed issues #4283

Summary

https://learn.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-addextendedproperty-transact-sql?view=sql-server-ver15 shows the sp_addextendedproperty accepts sysname datatype which is subtype of string datatype and therefore the values must be escaped as string literal instead of escaped identifier. This is evident also in the examples.

As the DBAL method arguments accepts possibly escaped identifier, we unescape it before we escape the argument as string literal.

@mvorisek mvorisek force-pushed the fix_mssql_comment_with_escaped_column branch 2 times, most recently from 8328273 to 314a224 Compare April 7, 2024 17:52
@greg0ire
Copy link
Member

The tests you modified assert that the expected SQL is generated, and did not fail before because that SQL is never actually sent to a server. Please add a functional test that covers the issue you're fixing.

@mvorisek
Copy link
Contributor Author

Tests added.

@greg0ire
Copy link
Member

4111af9 should be squashed with 3171bc8

@mvorisek mvorisek force-pushed the fix_mssql_comment_with_escaped_column branch from 4111af9 to 607f7dd Compare April 22, 2024 08:09
@mvorisek
Copy link
Contributor Author

Done.

@derrabus derrabus merged commit 40e7b7c into doctrine:3.8.x May 3, 2024
92 checks passed
@mvorisek mvorisek deleted the fix_mssql_comment_with_escaped_column branch May 3, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants