CRM-13059 fix relationship killing query
Merge pull request #1168 from eileenmcnaughton/CRM-13059

CRM-13059 fix relationship killing query