The issue was already fixed in 5.7.18 with the following commit:
commit c90aba97ee76f65770f6b4641edef1c32db58279 Author: Debarun Banerjee <email address hidden> Date: Sun Nov 13 10:31:35 2016 +0530
BUG#25082593 FOREIGN KEY VALIDATION DOESN'T NEED TO ACQUIRE GAP LOCK IN READ COMMITTED
The issue was already fixed in 5.7.18 with the following commit:
commit c90aba97ee76f65 770f6b4641edef1 c32db58279
Author: Debarun Banerjee <email address hidden>
Date: Sun Nov 13 10:31:35 2016 +0530
BUG#25082593 FOREIGN KEY VALIDATION DOESN'T NEED TO ACQUIRE GAP LOCK
IN READ COMMITTED