0

I'm testing out Civicrm. Started with Wordpress then copied the database into Drupal 7

When trying to send a mailing to a group, the send test email issues

Error in call to Mailing_send_test : DB Error: syntax error

And trying to submit the mailing gives DB Error: syntax error

From the logs I can see

 [code] => -2
[message] => DB Error: syntax error
[mode] => 16
[debug_info] => INSERT IGNORE INTO civicrm_tmp_e_gccache_e014dbed46046aa1c0657ac431a08f53 (group_id, contact_id)  [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]
[type] => DB_Error
[user_info] => INSERT IGNORE INTO civicrm_tmp_e_gccache_e014dbed46046aa1c0657ac431a08f53 (group_id, contact_id)  [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]
[to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="INSERT IGNORE INTO civicrm_tmp_e_gccache_e014dbed46046aa1c0657ac431a08f53 (group_id, contact_id)  [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]"]

Edit - looks like this is the same issue as Smart Group DB error

Answer given was - It has been reported here https://github.com/civicrm/civicrm-core/pull/17622 and it should be fixed by the CiviCRM 5.26.2.

2 Answers 2

2

Tested the fix from https://github.com/civicrm/civicrm-core/pull/17622 & can confirm it's now working as expected.

1
  • We just started experiencing this error in 5.29.0, is anyone who previously had this issue experiencing a regression, or is there possibly a new error now? (we went from 5.25 to 5.27 so never experienced this previously) Commented Sep 15, 2020 at 16:50
0

We just experienced this with the newest version October 2022 /54. In relation to smart groups and the search function. Also when exporting contacts. Is the patch from 2020 safe?

'ERROR message: DB Error: syntax error code:
exception: PEAR_Exception Object ( [cause:protected] => DB_Error Object ( [error_message_prefix] => [mode] => 16 [level] => 1024 [code] => -2 [message] => DB Error: syntax error [userinfo] => INSERT IGNORE INTO civicrm_tmp_e_gccache_1e5c7912afe5baa5f381309ac26f4b75 (group_id, contact_id) SELECT 486 AS group_id, contact_a.id as id FROM civicrm_contact contact_a WHERE ( ( contact_a.created_date >= '20191001000000' ) ) AND (contact_a.is_deleted = 0) AND contact_a.id NOT IN ( SELECT contact_id FROM civicrm_group_contact WHERE civicrm_group_contact.status = 'Removed' AND civicrm_group_contact.group_id = 486 ) [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';= '20191001000000' ) ) AND (contact_a.is_deleted = 0) AND contact_a.id NOT IN' at line 1] [backtrace] => Array ( [0] => Array ( [file] => /srv/www/html/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB.php [line] => 997 [function] => __construct [class] => PEAR_Error [type] => -> [args] => Array ( [0] => DB Error: syntax error [1] => -2 [2] => 16 [3] => Array ( [0] => CRM_Core_Error [1] => exceptionHandler )

                               [4] => INSERT IGNORE INT...

LAST ERROR Array ( [type] => 16384 [message] => Calling the "Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch()" method with the event name as the first argument is deprecated since Symfony 4.3, pass it as the second argument and provide the event object as the first argument instead. [file] => /srv/www/html/wordpress/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php [line] => 58 ) '

1
  • My solution was - - - Mysql settings: more power 1GB
    – Mich___
    Commented Oct 12, 2022 at 11:51

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.