Bug #12730 Insert column "Executed" improperly
Submitted: 22 Aug 2005 18:34 Modified: 16 Dec 2008 15:28
Reporter: Mike Hofman Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S4 (Feature request)
Version:1.1.6, 1.1.13 OS:Linux (Linux, Windows)
Assigned to: CPU Architecture:Any

[22 Aug 2005 18:34] Mike Hofman
Description:
When editing a already created table there is a problem with inserting new columns.  New columns are always inserted at the end of the table.  This seems to be a problem in the "AFTER" clause in that it does not pick up the correct column name in which it is inserting the new column after.

How to repeat:
create a table with the following column names:
col1, col2,col3

after executing the command close the edit window and edit the newly created table.
Insert a column in between col1 and col2 called col1_5.  Upon execution the column will be added to the end of the table.  The problem is specific to the "AFTER" clause.

Suggested fix:
Parse the "AFTER" clause correctly and fill in the appropriate column name.  It seems that it is parsing the last column name instead of the column name of the previous column as would be expected.
[26 Aug 2005 10:53] Valeriy Kravchuk
Thank you for the bug report. I tried to add new column using MySQL Table Editor of Query Browser version 1.1.13 (lates), and found no way to add it other than as a last one. How did you manage to add col1_5 between col1 and col2 at all?

I think it's simply a useful feature request. ALTER TABLE supports AFTER clause, so QB should some day support it to.
[26 Aug 2005 12:12] Mike Hofman
The way to get around this and actually "execute" correctly is to edit the sql statement right before commiting/executing it and changing the column in the AFTER clause.
[16 Dec 2008 15:28] Susanne Ebrecht
Thank you for your bug report. This issue has already been fixed in the latest released version of that product, which you can download at

  http://www.mysql.com/downloads/