Description: In Base part, in dialog process for duplicate a table, checking "Create new field as primary key" should indeed create a new field with Name indicated (by default "ID") but the existing primary key fields should be demoted to simple fields. Steps to Reproduce: 1. Enable experiment features (Tools/Options/Advanced) 2. Retrieve file https://bugs.documentfoundation.org/attachment.cgi?id=138647 3. Open file and go to "Tables panel" 4. Right click on the only table and select "Copy" 5. Right click on background of table panel and select "Paste..." => Copy table dialog opens 6. Let "Definition and data" and click on "Create new field as primary key" 7. Click Next 8. Click double arrow towards right to put both fields from left to right panel 9. Click Next Actual Results: There are 2 fields for primary key: - ID (as expected) - cardinal (not expected) Expected Results: Only field ID should be primary key Reproducible: Always User Profile Reset: No Additional Info: Reproduced with master sources updated yesterday User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
Lionel: here the bugtracker following your comment in https://gerrit.libreoffice.org/#/c/47684/
I submitted a patch to review here: https://gerrit.libreoffice.org/#/c/47732/
Julien Nabet committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=2711f7639811929fc9ea8dc168ea28f1c5545e67 tdf#114955: Fix primary key management in copy table It will be available in 6.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
For 6.0 branch, patch on review here: https://gerrit.libreoffice.org/#/c/47745/ I don't think it worths it to cherry-pick on 5.4 branch, so let's put this one to FIXED.
Julien Nabet committed a patch related to this issue. It has been pushed to "libreoffice-6-0": http://cgit.freedesktop.org/libreoffice/core/commit/?id=2481e7dd49b8c8fe0dc97ff86a2a35267c2c06d3&h=libreoffice-6-0 tdf#114955: Fix primary key management in copy table It will be available in 6.0.0.2. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.