0

I am on civicrm 4.6.5. From a Event Dashboard when I select the "Counted" link to see the list of participants, "DB Error: syntax error" appears on the screen. And from civicrm log I get the following message. So far it was working perfectly fine. I am not sure what went wrong!!! Can anyone help please?

Jul 21 12:30:53  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] => SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contact_a LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contact' AND
                                                        contact_a.id = civicrm_note.entity_id )  LEFT JOIN civicrm_participant ON civicrm_participant.contact_id = contact_a.id  INNER JOIN civicrm_event ON civicrm_participant.event_id = civicrm_event.id  LEFT JOIN civicrm_option_group option_group_event_type ON (option_group_event_type.name = 'event_type') LEFT JOIN civicrm_option_value event_type ON (civicrm_event.event_type_id = event_type.value AND option_group_event_type.id = event_type.option_group_id )  LEFT JOIN civicrm_discount discount ON ( civicrm_participant.discount_id = discount.id ) LEFT JOIN civicrm_option_group discount_name ON ( discount_name.id = discount.price_set_id )  LEFT JOIN civicrm_option_group option_group_participant_role ON (option_group_participant_role.name = 'participant_role') LEFT JOIN civicrm_option_value participant_role ON (civicrm_participant.role_id = participant_role.value
                               AND option_group_participant_role.id = participant_role.option_group_id )  LEFT JOIN civicrm_participant_status_type participant_status ON (civicrm_participant.status_id = participant_status.id)  WHERE  ( civicrm_event.id = 15 AND civicrm_participant.status_id 0 AND  civicrm_participant.role_id REGEXP '[[:<:]]1[[:>:]]|[[:<:]]2[[:>:]]|[[:<:]]3[[:>:]]|[[:<:]]4[[:>:]]'  AND civicrm_participant.is_test = 0 )  AND (contact_a.is_deleted = 0)     [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 '0 AND  civicrm_participant.role_id REGEXP '[[:<:]]1[[:>:]]|[[:<:]]2[[:>:]]|[[:<:' at line 3]
    [type] => DB_Error
    [user_info] => SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contact_a LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contact' AND
                                                        contact_a.id = civicrm_note.entity_id )  LEFT JOIN civicrm_participant ON civicrm_participant.contact_id = contact_a.id  INNER JOIN civicrm_event ON civicrm_participant.event_id = civicrm_event.id  LEFT JOIN civicrm_option_group option_group_event_type ON (option_group_event_type.name = 'event_type') LEFT JOIN civicrm_option_value event_type ON (civicrm_event.event_type_id = event_type.value AND option_group_event_type.id = event_type.option_group_id )  LEFT JOIN civicrm_discount discount ON ( civicrm_participant.discount_id = discount.id ) LEFT JOIN civicrm_option_group discount_name ON ( discount_name.id = discount.price_set_id )  LEFT JOIN civicrm_option_group option_group_participant_role ON (option_group_participant_role.name = 'participant_role') LEFT JOIN civicrm_option_value participant_role ON (civicrm_participant.role_id = participant_role.value
                               AND option_group_participant_role.id = participant_role.option_group_id )  LEFT JOIN civicrm_participant_status_type participant_status ON (civicrm_participant.status_id = participant_status.id)  WHERE  ( civicrm_event.id = 15 AND civicrm_participant.status_id 0 AND  civicrm_participant.role_id REGEXP '[[:<:]]1[[:>:]]|[[:<:]]2[[:>:]]|[[:<:]]3[[:>:]]|[[:<:]]4[[:>:]]'  AND civicrm_participant.is_test = 0 )  AND (contact_a.is_deleted = 0)     [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 '0 AND  civicrm_participant.role_id REGEXP '[[:<:]]1[[:>:]]|[[:<:]]2[[:>:]]|[[:<:' at line 3]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contact_a LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contact' AND
                                                        contact_a.id = civicrm_note.entity_id )  LEFT JOIN civicrm_participant ON civicrm_participant.contact_id = contact_a.id  INNER JOIN civicrm_event ON civicrm_participant.event_id = civicrm_event.id  LEFT JOIN civicrm_option_group option_group_event_type ON (option_group_event_type.name = 'event_type') LEFT JOIN civicrm_option_value event_type ON (civicrm_event.event_type_id = event_type.value AND option_group_event_type.id = event_type.option_group_id )  LEFT JOIN civicrm_discount discount ON ( civicrm_participant.discount_id = discount.id ) LEFT JOIN civicrm_option_group discount_name ON ( discount_name.id = discount.price_set_id )  LEFT JOIN civicrm_option_group option_group_participant_role ON (option_group_participant_role.name = 'participant_role') LEFT JOIN civicrm_option_value participant_role ON (civicrm_participant.role_id = participant_role.value
                               AND option_group_participant_role.id = participant_role.option_group_id )  LEFT JOIN civicrm_participant_status_type participant_status ON (civicrm_participant.status_id = participant_status.id)  WHERE  ( civicrm_event.id = 15 AND civicrm_participant.status_id 0 AND  civicrm_participant.role_id REGEXP '[[:<:]]1[[:>:]]|[[:<:]]2[[:>:]]|[[:<:]]3[[:>:]]|[[:<:]]4[[:>:]]'  AND civicrm_participant.is_test = 0 )  AND (contact_a.is_deleted = 0)     [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 '0 AND  civicrm_participant.role_id REGEXP '[[:<:]]1[[:>:]]|[[:<:]]2[[:>:]]|[[:<:' at line 3]"]
)


Jul 21 12:30:53  [info] $backTrace = #0 /srv/www/sites/all/modules/civicrm/CRM/Core/Error.php(235): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /srv/www/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /srv/www/sites/all/modules/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: syntax error", -2, 16, (Array:2), "SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
#4 /srv/www/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-2, 16, (Array:2), "SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
#5 /srv/www/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -2, NULL, NULL, "SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...", "DB_Error", TRUE)
#6 /srv/www/sites/all/modules/civicrm/packages/DB/mysql.php(899): DB_common->raiseError(-2, NULL, NULL, NULL, "1064 ** You have an error in your SQL syntax; check the manual that correspon...")
#7 /srv/www/sites/all/modules/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
#8 /srv/www/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
#9 /srv/www/sites/all/modules/civicrm/packages/DB/DataObject.php(2442): DB_common->query("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
#10 /srv/www/sites/all/modules/civicrm/packages/DB/DataObject.php(1634): DB_DataObject->_query("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
#11 /srv/www/sites/all/modules/civicrm/CRM/Core/DAO.php(325): DB_DataObject->query("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
#12 /srv/www/sites/all/modules/civicrm/CRM/Core/DAO.php(1221): CRM_Core_DAO->query("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...", TRUE)
#13 /srv/www/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(4609): CRM_Core_DAO::singleValueQuery("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
#14 /srv/www/sites/all/modules/civicrm/CRM/Event/Selector/Search.php(288): CRM_Contact_BAO_Query->searchQuery(0, 0, NULL, TRUE, FALSE, FALSE, FALSE, FALSE, NULL)
#15 /srv/www/sites/all/modules/civicrm/CRM/Core/Selector/Controller.php(233): CRM_Event_Selector_Search->getTotalCount(4, NULL)
#16 /srv/www/sites/all/modules/civicrm/CRM/Event/Form/Search.php(336): CRM_Core_Selector_Controller->__construct(Object(CRM_Event_Selector_Search), NULL, NULL, 4, Object(CRM_Event_Form_Search), 1, NULL)
#17 /srv/www/sites/all/modules/civicrm/CRM/Event/Form/Search.php(124): CRM_Event_Form_Search->postProcess()
#18 /srv/www/sites/all/modules/civicrm/CRM/Core/Form.php(455): CRM_Event_Form_Search->preProcess()
#19 /srv/www/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(94): CRM_Core_Form->buildForm()
#20 /srv/www/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Event_Form_Search), "display")
#21 /srv/www/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Event_Form_Search), "display")
#22 /srv/www/sites/all/modules/civicrm/CRM/Core/Controller.php(353): HTML_QuickForm_Page->handle("display")
#23 /srv/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(312): CRM_Core_Controller->run((Array:3), NULL)
#24 /srv/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:14))
#25 /srv/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
#26 /srv/www/sites/all/modules/civicrm/drupal/civicrm.module(489): CRM_Core_Invoke::invoke((Array:3))
#27 [internal function](): civicrm_invoke("event", "search")
#28 /srv/www/includes/menu.inc(519): call_user_func_array("civicrm_invoke", (Array:2))
#29 /srv/www/index.php(21): menu_execute_active_handler()
#30 {main}

1 Answer 1

2

This is a bug that was introduced in 4.6.5. My guess is 4.6.6 will be out pretty quickly as a result!

Check here if you want to jump in & patch your install

https://issues.civicrm.org/jira/browse/CRM-16858

Your Answer

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

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