Foreign key constraints failures
It looks like your data types don't match. In order to create a foriegn key between two tables the data types must be the same. You have comment_id in the longdesc table as INT(11) and comment_id in the trace table as MEDIUMINT(9).

I hope this helps you.