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.