Bug #72844 Index out of range in Form Editor
Submitted: 2 Jun 2014 23:20 Modified: 19 Jun 2014 2:05
Reporter: Andrew Johnson Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:6.1.6.11834 OS:Windows (Professional 64bit )
Assigned to: CPU Architecture:Any
Tags: Form Editor, workbench

[2 Jun 2014 23:20] Andrew Johnson
Description:
When trying to add another record using the form editor, error pops up stating
"Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"

How to repeat:
1) Select all data from a table
2) Enter the Form Editor Mode
3) Add a new record
4) Click "Add Record Button"
error occurs

Suggested fix:
You have to apply the first new record. Then rerun the select statement in order to add another record in the Form Editor
[3 Jun 2014 7:05] MySQL Verification Team
Hello Andrew,

Thank you for the bug report.
Verified as described.

Thanks,
Umesh
[3 Jun 2014 7:12] MySQL Verification Team
Easy to reproduce on windows, could not repeat on CentOS 6.5.
Note: Had to use bigger table on windows to reproduce this issue

mysql> drop table if exists keyvalue;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> CREATE TABLE `keyvalue` (
    ->   `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    ->   `name` varchar(250),
    ->   PRIMARY KEY (`id`)
    -> ) ENGINE=innodb;
Query OK, 0 rows affected (0.02 sec)

mysql> set @id:=0;
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql>  insert into `keyvalue` values (@id:=@id+1,md5(rand()*1000000)),(@id:=@id+1,md5(rand()*1000000)),(@id:=@id+1,md5(rand()*1000000)),(@id:=@id+1,md5(rand()*1000000));
Query OK, 4 rows affected (0.01 sec)
Records: 4  Duplicates: 0  Warnings: 0

mysql> insert into `keyvalue`(`id`,`name`)
    ->    select @id:=@id+1,md5(rand()*1000000) from
    ->     `keyvalue` k1, `keyvalue` k2, `keyvalue` k3, `keyvalue` k4,`keyvalue` k5,`keyvalue` k6, `keyvalue` k7, `keyvalue` k8, `keyvalue` k9,
    -> `keyvalue` k0,`keyvalue` ka, `keyvalue` kb, `keyvalue` kc, `keyvalue` kd limit 10000;
Query OK, 10000 rows affected (1.48 sec)
Records: 10000  Duplicates: 0  Warnings: 0

Try the exact steps outlined in the bug report for how to part..
[19 Jun 2014 2:05] Philip Olson
Fixed as of the upcoming MySQL Workbench 6.1.7 release, and here's the changelog entry:

The Form Editor could generate an "Index was out of range" error after
adding a new record and then clicking "Add Record".

Thank you for the bug report.