1

Following up the php 8.1 issue PHP Fatal error: Uncaught IntlException: datefmt_create: invalid locale: U_ILLEGAL_ARGUMENT_ERROR have tried to jump to the latest 5.67.0 and got the one below, sticking with the "5.67.alpha1" version.

UPDATE civicrm_mailing_event_queue q INNER JOIN civicrm_mailing_job job ON job.id =
 q.job_id SET q.mailing_id = job.mailing_id, q.is_test=job.is_test 
WHERE q.id >= 1000006 AND q.id <= 1500005 AND q.mailing_id IS NULL 
[nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails
 (`civicrm_prod`.`civicrm_mailing_event_queue`, CONSTRAINT    
 `civicrm_mailing_event_queue_ibfk_1` FOREIGN KEY (`mailing_id`) REFERENCES 
`civicrm_mailing` (`id`) ON DELETE SET NULL)]

Checking for records violating the constraint returned zero results SELECT * FROM civicrm_mailing_event_queue q WHERE q.mailing_id IS NULL AND q.mailing_id NOT IN (SELECT id FROM civicrm_mailing);

Temporary workaround is to run the query manually with the "Enable foreign key checks" disabled, however this might be not quite right. Anyone else having the same luck? Any word of advice please? Thanks.

1 Answer 1

6

There are orphan data in civicrm_mailing_job table. Below query should return you the count

SELECT count(*)
FROM civicrm_mailing_job j
  LEFT JOIN civicrm_mailing m
    ON m.id = j.mailing_id
WHERE m.id IS NULL;

To delete you can use

DELETE j.*
    FROM civicrm_mailing_job j
      LEFT JOIN civicrm_mailing m
        ON m.id = j.mailing_id
    WHERE m.id IS NULL;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.