bug #3871 Check referential integrity broken across databases