Bug #110565 Adding a fulltext index causes a "Duplicate entry '0'" for the primary key
Submitted: 30 Mar 2023 10:52 Modified: 17 Apr 2023 18:28
Reporter: Saverio Miroddi Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: FULLTEXT search Severity:S3 (Non-critical)
Version:8.0.32 OS:Any
Assigned to: CPU Architecture:Any

[30 Mar 2023 10:52] Saverio Miroddi
Description:
With a certain dataset, adding a fulltext key causes the error:

  Duplicate entry '0' for key '<tablename>.PRIMARY'

The error is puzzling, because:

- the index is added on a second stage, and there is a PK on the table already, which implies that the data is correct
- there is no record with PK=0

The error log doesn't show anything when the error happens.

The bug reproduces 100% of the times on my setup. I've restarted the MySQL server multiple times; before each time, I've destroyed the data dir.

The bug also reproduces on MySQL 8.0.28.

I'm sending the dataset separately.

How to repeat:
A dataset is provided. Just run `cat *.sql | mysql <dbname>`.
[30 Mar 2023 11:34] MySQL Verification Team
Hello Saverio Miroddi,

Thank you for the report and test case.
Verified as described.

regards,
Umesh
[17 Apr 2023 18:28] Saverio Miroddi
I wasn't able to find any workaround, except dropping all the indexes on the table, including the primary key (!).