Subject: | "insert" method does not auto-increment when used with an existing object |
Environment: perl 5.8.5, mysql, RDBO v0.758, Linux 2.6.5
To reproduce:
1) create a table with an AUTO_INCREMENT column as the primary key, and
some other column as data. Populate one row.
2) create an Rose::DB::Object for that table
3) load an RDBO object for the row you created in step 1
4) alter the data via the object, i.e. $obj->data('something different')
5) insert the new row with $obj->insert or $obj->save(insert => 1)
You get a duplicate entry error for this new row.
I expected:
A new row inserted with the primary key incremented, and different data
in the second column.
Workaround:
Manually create a new row with the "new" method. This can be painful
if you want to copy another row, but change only one column's data.