-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Comments
Can As currently designed, the behavior of |
No, |
@aimeos so what do you expect to happen as a result of such a call to |
@morozov Using |
There won't be an error. "dbo.test2" is a valid table name, so that will be the new name. Could you check if #6602 solves your problem? |
Yes, it fixes the problem. You are right, |
This would implicitly drop part of the data supplied by the user. Not the best idea. The proper approach is to parse the name as an |
If the value is quoted and passed to the sp_rename function that way, it will again rename to w wrong table name. When |
You're missing this part:
Please take a look at #6646 for context. |
Bug Report
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
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:
dbal/src/Platforms/SQLServerPlatform.php
Line 498 in dadd353
The text was updated successfully, but these errors were encountered: