Additional fix for table join (fixes #7068, fixes #7271)