AnsweredAssumed Answered

SQL bug 7.8.2 email suppression

Question asked by Brad Foster on May 17, 2017

The following query in queuecampaign.php line 145 (approx)

 

$delete_query "DELETE FROM emailman WHERE emailman.campaign_id='{$campaign->id}' AND (emailman.related_id, emailman.related_type) IN
   (SELECT plp.related_id, plp.related_type FROM prospect_lists_prospects plp
      INNER JOIN prospect_lists pl ON pl.id = plp.prospect_list_id
      INNER JOIN prospect_list_campaigns plc ON plp.prospect_list_id = plc.prospect_list_id
      WHERE plp.deleted = 0 AND plc.deleted = 0 AND pl.deleted = 0 AND pl.list_type = 'exempt' AND  plc.campaign_id = '{$campaign->id}')
   ";

This is supposed to remove anyone in a suppression list but it fails in SQL server so emails get sent to people they shouldn't.  Pretty serious

 

It only changed in 7.8.2 because in older versions it used concat(related_id,related_type) which worked fine.

 

Now I get the error

 also showing as fatal in sugar log.

Outcomes