Bug #118210 Invisible Index Binlog Replay Bugfix
Submitted: 16 May 10:15 Modified: 18 May 16:42
Reporter: alex xing (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:8.0.42 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[16 May 10:15] alex xing
Description:
Background:
If optimizer_switch="use_invisible_indexes=on", the replay phase could select an invisible index. However, the previous logic did not check this condition.

Fix:
Replace keyinfo->is_visible with table->s->usable_indexes(current_thd).is_set(key).

How to repeat:
just read the code

Suggested fix:
fix as the below patch
[16 May 10:16] alex xing
a simple patch to describe the bugfix

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: invisible_index_bug_fix.patch (application/octet-stream, text), 680 bytes.

[18 May 16:42] MySQL Verification Team
Hello Alex Xing,

Thank you for the report and contribution.

regards,
umesh