How to select from two tables where the rows may be or may not be equal and group it if they are equal
FULL JOIN is not implemented in MySQL. 

Possible realization (model):

SELECT filename,
       CASE SUM(table_from) WHEN 1 THEN 'In first table'
                            WHEN 2 THEN 'In second table'
                            ELSE        'In both tables'
                            END AS where_it_is
FROM ( SELECT filename, 1 AS table_from
       FROM table1
       UNION DISTINCT
       SELECT filename, 2
       FROM table2 ) AS combined_data_array
GROUP BY filename


If the field in question is unique in each separate table then use UNION ALL instead of UNION DISTINCT.