Fixed #22291 -- Avoided shadowing deadlock exceptions on MySQL.

Thanks err for the report.