Fixed #20337 -- Change copy when database relation is not allowed