SELECT
    magic_ds_id,
    exp_id,
    re_place,
    camera,
    stage,
    stage_id,
    component,
    outroot,
    diffSkyfile.path_base,
    "NULL" AS cam_path_base,
    0 AS bytes,
    0 AS md5sum
FROM magicDSRun
    JOIN magicRun using(magic_id)
    JOIN magicDSFile USING(magic_ds_id)
    JOIN diffSkyfile ON (stage_id = diffSkyfile.diff_id AND component = skycell_id)
    JOIN rawExp USING(exp_id)
WHERE magicDSRun.stage = 'diff'
    AND (magicDSRun.state = 'new' OR magicDSRun.state = 'censored')
    AND magicDSFile.fault > 0
