Bug #4739 Adding more then one column in one step will cause wrong order
Submitted: 24 Jul 2004 22:08 Modified: 31 Jul 2004 19:25
Reporter: Jan Riedel Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Administrator Severity:S2 (Serious)
Version:1.0.3 A OS:Windows (XP Pro)
Assigned to: Michael G. Zinner CPU Architecture:Any

[24 Jul 2004 22:08] Jan Riedel
Description:
If you enter more then one new column in the TableEditor and "Apply Changes" the executed ALTER-statement stores the column in the wrong order. The last entered column will appear as the first - the first will appear at the end.

How to repeat:
Enter more than one columns in the TableEditor and then press "Apply Changes". Close the TableEditor and reopen it. The order of the new columns now changed.

Suggested fix:
Change the Alter-Statement in that way, that the order correct. 

For that you have to change the AFTER-Value

Buggy:
ALTER TABLE `cookie`.`jk2_user` ADD COLUMN `bitRogerWilco` TINYINT UNSIGNED NOT NULL AFTER `bitGameVoice`
, ADD COLUMN `bitTeamSpeak` TINYINT UNSIGNED NOT NULL AFTER `bitGameVoice`;

Correct:
ALTER TABLE `cookie`.`jk2_user` ADD COLUMN `bitRogerWilco` TINYINT UNSIGNED NOT NULL AFTER `bitGameVoice`
, ADD COLUMN `bitTeamSpeak` TINYINT UNSIGNED NOT NULL AFTER `bitRogerWilco`;

(its naggy to press "Apply" after every column)
[27 Jul 2004 2:17] Matthew Lord
I was able to verify this in 1.0.8.
[28 Jul 2004 21:51] Jan Riedel
I hope this bug will also fixed at the Browser. :-)
[31 Jul 2004 19:25] Michael G. Zinner
Thanks for reporting. This bug has been fixed and will be in the next release of MA and QB.
[5 Mar 2009 5:34] sharan honnashetty
he written the sql command exactly and fantastic, thanku

- sharan