[mssql] Column rename works incorrectly resulting in glitched column names.
Database management in a single PHP file
Brought to you by:
jakubvrana
From "Alter Table" menu, if you change the name of the column, saved name has square brackets included as part of the name.
When checked in SQL Management Studio it looked like:
[[NewColumn]]]
I've checked Adminer's history and found following code:
EXEC sp_rename '[Schema].[Table].[OldColumn]', '[NewColumn]', 'COLUMN';
According to documentation of Microsoft, square brackets not to be used for input parameters.
Correct statement is:
EXEC sp_rename 'Schema.Table.OldColumn', 'NewColumn', 'COLUMN';
That's a deadly bug, as there is now way to rename the column to an acceptable name.
I don't see how this could happen. https://github.com/vrana/adminer/commit/8ec7178
Oh, it was fixed by b8c5eec.