The bug was introduced in MariaDB 10.4.0 by
commit 0e5a4ac2532c64a545796c787354dc41d61d0e62
but it is good to have a regression test for this scenario
in all applicable MariaDB versions.
Cover the purge of an undo log record that was written before
the completion of ADD SPATIAL INDEX.