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

SQLServer renameTable() problem #6566

Open
aimeos opened this issue Oct 21, 2024 · 0 comments
Open

SQLServer renameTable() problem #6566

aimeos opened this issue Oct 21, 2024 · 0 comments

Comments

@aimeos
Copy link
Contributor

aimeos commented Oct 21, 2024

Bug Report

Q A
Version 3.9/4.2

Summary

SQL Server uses sp_rename function for renaming tables but using quotes for target table name results in wrong table name.

How to reproduce

$schemaManager->renameTable('[test]', '[dbo.test2]');
// -> sp_rename '[test]', '[dbo.test2]'

The new table is now named "[dbo.test2]" instead of "test2". This does only occur in SQLServer platform, all other platforms use quoting as expected so this is inconsistent between SQLServer platform and all other platforms.

Expected behaviour

Quotes for the target table name should be automatically removed by the SQLServer platform here to get consistent results:
https://github.com/doctrine/dbal/blob/4.2.x/src/Platforms/SQLServerPlatform.php#L498

$schemaManager->renameTable('[test]', '[dbo.test2]');
// -> sp_rename '[test]', 'test2'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants