Bug #111015 old index auto change Visible when duplicate index name
Submitted: 12 May 2023 9:32 Modified: 26 May 2023 8:50
Reporter: Khanh Van Chu Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version: OS:Windows
Assigned to: CPU Architecture:x86

[12 May 2023 9:32] Khanh Van Chu
Description:
When I copy existing index name, to create a new index name, but forgot to change index name, then the old index changed the Visible option to none.

How to repeat:
1. create a model: mydb
2. create a table: table1
3. create 3 columns: id (PRIMARY), col1 VARCHAR(45), col2 VARCHAR(45)
4. open tab Indexes: add index idx_table1_col1, type = INDEX, column = col1
5. double click on index name idx_table1_col1, then copy this name: idx_table1_col1
6. move to the row below, paste idx_table1_col1
6.1: If I change name (row below) idx_table1_col1 to idx_table1_col2 right here => no bug
6.2: If I forgot to change index name idx_table1_col1 (click mouse to any where, to lose focus on index name) => 2 indexes with same name idx_table1_col1
comback to row above: idx_table1_col1, the Visible of idx_table1_col1 is auto changed to unchecked.
- Then I changed second index (row below): idx_table1_col1 => idx_table1_col2, the idx_table1_col1 (firt index, row above) is still unchecked

=> The first index now is Invisible.

Suggested fix:
1. Warning if there are 2 indexes with the same name.
2. Prevent auto uncheck of first index: idx_table1_col1, let user remove second index or must change index name.
[12 May 2023 9:32] Khanh Van Chu
test_mydb.mwb

Attachment: test_mydb.mwb (application/octet-stream, text), 5.27 KiB.

[12 May 2023 9:33] Khanh Van Chu
1.jpg

Attachment: 1.jpg (image/jpeg, text), 188.43 KiB.

[12 May 2023 9:33] Khanh Van Chu
2.jpg

Attachment: 2.jpg (image/jpeg, text), 217.80 KiB.

[12 May 2023 9:34] Khanh Van Chu
3.jpg

Attachment: 3.jpg (image/jpeg, text), 205.33 KiB.

[12 May 2023 9:34] Khanh Van Chu
4.jpg

Attachment: 4.jpg (image/jpeg, text), 206.81 KiB.

[12 May 2023 9:34] Khanh Van Chu
5.jpg

Attachment: 5.jpg (image/jpeg, text), 205.82 KiB.

[12 May 2023 13:18] MySQL Verification Team
Hello Khanh,

Thank you for the bug report.
Imho, this is by design and not a bug. The Visible of idx_table1_col1 is auto changed to unchecked even when non duplicate index name was given. Tried adding two or more indexes(duplicate/non-duplicate) and the results remain same.

Regards,
Ashwini Patil
[12 May 2023 13:23] MySQL Verification Team
8.0.33 test results

Attachment: 111015_test_results.docx (application/vnd.openxmlformats-officedocument.wordprocessingml.document, text), 360.66 KiB.

[26 May 2023 8:50] Khanh Van Chu
Check this video for instructions https://drive.google.com/file/d/1gQGbALblbkwIJwPXesvSbTTt1gDNFf1e/view
- In both case: duplicate and none duplicate index name, the Visible of index col1 auto change to Invisible.
- Expected: remain Visible.