Bug #70189 Alter table on large table produces error invalid map/set<T> iterator
Submitted: 29 Aug 2013 22:19 Modified: 5 Sep 2013 1:02
Reporter: Bob Dankert Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S1 (Critical)
Version:6.0.6.11184 OS:Windows (W7 64-bit)
Assigned to: CPU Architecture:Any
Tags: ALTER TABLE, invalid, iterator, map/set

[29 Aug 2013 22:19] Bob Dankert
Description:
When applying a simple update on a large table, the results of the apply SQL displays an error that appears to be an internal code issue. I have included a screen shot of the error. The SQL being executed is pretty simple:

ALTER TABLE `database_name`.`large_table` 
ADD COLUMN `test_column` INT UNSIGNED NULL AFTER `check_status_email_id`;

Of note, this table has about 100 columns, 30 indexes, and 30 foreign keys. We don't see this error on smaller tables, but we do experience this on a number of larger tables. After the error occurs when applying the change, there are a number of things that start to perform oddly and with unexpected results.

We've seen this occur on the same table structures from a number of different databases and on a number of different computers. I say different databases with the same table structure as we have several development databases, plus 3 staging databases and production, all with the same table structures.

It's also worth noting that even though the error happens, the SQL TABLE SQL command is executed successfully. Workbench doesn't know this, though, so you have to close out of the alter table tab and right-click in the navigator and do a refresh-all.

How to repeat:
Use Workbench to add a column to a table. The error also happens when trying to add an index to the table, or a foreign key to the table. It seems that executing any alter to the table causes this.

Suggested fix:
Don't experience the error :)
[29 Aug 2013 22:19] Bob Dankert
Visual of the error

Attachment: mysql_bug_capture.JPG (image/jpeg, text), 46.32 KiB.

[29 Aug 2013 22:33] Alfredo Kojima
Could you attach the definition of one of such large tables where the error can be repeated?
[30 Aug 2013 16:51] Bob Dankert
I've added the create statement, but restricted it so only developers can see it. There is only one record in this table currently, FYI, so the amount of data in the table doesn't seem to be a factor.
[30 Aug 2013 16:52] Bob Dankert
It's worth noting that this did not happen in the 5.x WB, and we never experienced it in any of the beta/RC versions of the 6.x WB.
[3 Sep 2013 14:33] Neil Tompkins
I have just come across this problem using MySQL Server 5.6.13 and Workbench version Build 6.0.6.11184.  Basically when I try to modify a Trigger, I get the same error message.  

The problem doesn't happened on all tables.
[3 Sep 2013 15:26] Bob Dankert
Our tables didn't have triggers, but a number of fields, indexes, and foreign keys.
[3 Sep 2013 19:37] Jacob Campbell
I'm receiving this same error message when altering a couple of rather small/simple tables as well..  And any further attempts to apply updates in the same alter table window fail with message, "Selected name conflicts with existing table ".  Closing and re-opening the alter table window allows for another update to the table..  For what it's worth; closing and re-opening the Workbench (current version 6.0.6.111?4) does not remove the error..

Not sure what the cause/remedy is yet..  Probably something very simple though..
[4 Sep 2013 0:09] Jacob Campbell
I believe this may be related to Indexes created (or not created) for Foreign Keys being added in interface..
[4 Sep 2013 0:51] MySQL Verification Team
Please try version 6.0.7. Thanks.
[4 Sep 2013 1:11] Bob Dankert
The same alter statements that previously caused the problem in 6.0.6 are working properly thus far in 6.0.7.
[5 Sep 2013 1:02] MySQL Verification Team
Thank you for the feedback.
[5 Sep 2013 12:32] Jacob Campbell
6.07 seems to have resolved my related problem..  

However, I can't comment about Bob & Neil  ;-)