Smart groups created before 5.5.0 using "relation_permission" break on upgrade to 5.5.0
Because of changes introduced by https://github.com/civicrm/civicrm-core/pull/12415, CiviCRM 5.5.0 generates fatal SQL when running some smart groups created in previous versions.