Menu

#4523 (ok 4.2.9) tbl_change.js: insert as new row submit type on multiple selected records does not set all AUTO_INCREMENTs to 0 value

4.2.7
fixed
1
2014-09-20
2014-08-25
No

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.)

1 Attachments

Discussion

  • Hugues Peccatte

    Hugues Peccatte - 2014-09-14
    • assigned_to: Hugues Peccatte
     
  • Alexander Kamp

    Alexander Kamp - 2014-09-15

    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.

     
  • Marc Delisle

    Marc Delisle - 2014-09-15
    • summary: tbl_change.js: insert as new row submit type on multiple selected records does not set all AUTO_INCREMENTs to 0 value --> (ok 4.2.9) tbl_change.js: insert as new row submit type on multiple selected records does not set all AUTO_INCREMENTs to 0 value
    • status: open --> resolved
    • Priority: 5 --> 1
     
  • Marc Delisle

    Marc Delisle - 2014-09-20
    • Status: resolved --> fixed