[1.7.x] Fixed #22944: Bad dependency on FK alteration in autodetector