Looks like foreign keys tied to non-unique keys is an InnoDB extension to MySQL.  When *any* row of the foreign key is deleted, the change will cascade delete every dependent row even if the foreign key constraint is still met (due to duplicate key).

We could have a single-column table just to hold threadIDs and thereby prevent this weirdness.