I found a small issue in PMA. In case you want to edit multiple records and inserting them as new, only the first record AUTO_INCREMENT value is set to 0.
How to reproduce:
- Choose a table which as an AUTO_INCREMENT index and more dan one record
- Browse/explore contents of it
- Check at least two records
- Below all shown records, click the Pencil/Change to edit the selected items.
- In the actions panel you can choose to 'Save' and 'Go back'. After selecting 'Insert as new row' (in submit_type) only the first record AUTO_INCREMENT value is to 0. In my opinion AUTO_INCREMENT field for both records should be '0'.
File tbl_change.js sets the event for changing submit_type (row 313-328). Only the first occurrence of 'insertRowTable' will be processed.
For illustration I attached a diff file which shows my changes to make it work. (Then you can merge it into PMA style of coding.)
I sent a PR: https://github.com/phpmyadmin/phpmyadmin/pull/1357
I applied the pull request and it works like expected.
In response to your question at Github:'
My intention indeed was to update only the first found AUTO_INCREMENT column per record. You can call it a 'safe approach'.
ps. When I try to create a table having multiple AUTO_INCREMENT columns it refuses to create table. It can have only one AUTO_INCREMENT column per table (message: "#1075: Incorrect table definition; there can only be one auto column..."). As a result, both approaches will work.