Here is an extract that helps to reproduce the problem quite easily:
Normally it would go to the end and print "All done". With the bug, it stops in the middle with "Query execution was interrupted". Tried Linux and Windows, release and debug builds (particularly, BUILD/compile-pentium-debug-max-no-ndb).
It started happening after MDEV-3941, with this revision: