bug #3871 Check referential integrity broken across databases
Merge branch 'QA_4_0'