I have just tried again by entering the following SQL:
SELECT NULL AS ID, rg.ID AS GROUP_ID, arp.START_DATE, arp.END_DATE, arp.TEACHING_BLOCK, 'SEMINAR' AS TYPE,
SUBSTRING_INDEX( rg.NAME, ' ', 1 ) AS MODULE, NULL AS STAFF_CODE, 0 AS DELETED
FROM attendance_tutorials.attendance_register_periods AS arp
INNER JOIN attendance_tutorials.register_groups AS rg
WHERE arp.GROUP_ID = 30386
AND rg.ID BETWEEN 19500 AND 19999
;
It didn't happen the first time but after pressing F9 a few times - it crashed at exactly the same place after the 5th press. It doesn't seem to matter what SQL I choose to execute - this was just a query I had handy.
I left a second between the previous query completing (which it does in <1 second) and the next press of F9.