[1.7.x] Fixed #23719 -- Fixed MySQL 5.6 crash with GeometryFields in migrations.

Backport of 03bd79ed2 from master