CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • DB Error: syntax error after upgrade from 3.4.8 to 4.1.5 (Drupal 6)
Pages: [1]

Author Topic: DB Error: syntax error after upgrade from 3.4.8 to 4.1.5 (Drupal 6)  (Read 7728 times)

michaels23

  • I post occasionally
  • **
  • Posts: 77
  • Karma: 1
DB Error: syntax error after upgrade from 3.4.8 to 4.1.5 (Drupal 6)
May 23, 2013, 06:35:42 pm
I just upgraded from 3.4.8 to 4.1.5 (Drupal 6). Everything works great except events. Almost every event-related 'operation' results in the backtrace and error details below.

I've been able to use phpMyAdmin to trouble-shoot the syntax. All I needed to do is remove one of the DISTINCT arguments at the beginning of the query.

All I know is this fixes the syntax error. I have know idea if this is the 'correct' fix or how to actually implement it in CiviEvent?

Code: [Select]
backTrace

/home/scethics/scethics.org/sites/all/modules/civicrm/CRM/Core/Error.php, backtrace, 146
, handle,
/home/scethics/scethics.org/sites/all/modules/civicrm/packages/PEAR.php, call_user_func, 931
/home/scethics/scethics.org/sites/all/modules/civicrm/packages/DB.php, PEAR_Error, 968
/home/scethics/scethics.org/sites/all/modules/civicrm/packages/PEAR.php, DB_Error, 564
/home/scethics/scethics.org/sites/all/modules/civicrm/packages/DB/common.php, raiseError, 1903
/home/scethics/scethics.org/sites/all/modules/civicrm/packages/DB/mysql.php, raiseError, 898
/home/scethics/scethics.org/sites/all/modules/civicrm/packages/DB/mysql.php, mysqlRaiseError, 327
/home/scethics/scethics.org/sites/all/modules/civicrm/packages/DB/common.php, simpleQuery, 1216
/home/scethics/scethics.org/sites/all/modules/civicrm/packages/DB/DataObject.php, query, 2428
/home/scethics/scethics.org/sites/all/modules/civicrm/packages/DB/DataObject.php, _query, 1614
/home/scethics/scethics.org/sites/all/modules/civicrm/CRM/Core/DAO.php, query, 153
/home/scethics/scethics.org/sites/all/modules/civicrm/CRM/Core/DAO.php, query, 929
/home/scethics/scethics.org/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php, singleValueQuery, 3921
/home/scethics/scethics.org/sites/scethics.org/files/civicrm/php/CRM/Event/Selector/Search.php, searchQuery, 289
/home/scethics/scethics.org/sites/all/modules/civicrm/CRM/Core/Selector/Controller.php, getTotalCount, 239
/home/scethics/scethics.org/sites/all/modules/civicrm/CRM/Event/Form/Search.php, __construct, 461
/home/scethics/scethics.org/sites/all/modules/civicrm/CRM/Event/Form/Search.php, postProcess, 191
/home/scethics/scethics.org/sites/all/modules/civicrm/CRM/Core/Form.php, preProcess, 327
/home/scethics/scethics.org/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php, buildForm, 97
/home/scethics/scethics.org/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php, perform, 203
/home/scethics/scethics.org/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php, handle, 103
/home/scethics/scethics.org/sites/all/modules/civicrm/CRM/Core/Controller.php, handle, 292
/home/scethics/scethics.org/sites/all/modules/civicrm/CRM/Event/Page/Tab.php, run, 57
/home/scethics/scethics.org/sites/all/modules/civicrm/CRM/Event/Page/Tab.php, browse, 186
/home/scethics/scethics.org/sites/all/modules/civicrm/CRM/Core/Invoke.php, run, 245
/home/scethics/scethics.org/sites/all/modules/civicrm/drupal/civicrm.module, invoke, 381
, civicrm_invoke,
/home/scethics/scethics.org/includes/menu.inc, call_user_func_array, 352
/home/scethics/scethics.org/index.php, menu_execute_active_handler, 17

error details
Code: [Select]
Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] => SELECT count( DISTINCT  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.option_group_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  ( contact_a.id = 1758 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 'DISTINCT(civicrm_participant.id) )  FROM civicrm_contact contact_a LEFT JOIN civ' at line 1]
    [type] => DB_Error
    [user_info] => SELECT count( DISTINCT  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.option_group_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  ( contact_a.id = 1758 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 'DISTINCT(civicrm_participant.id) )  FROM civicrm_contact contact_a LEFT JOIN civ' at line 1]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT count( DISTINCT  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.option_group_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  ( contact_a.id = 1758 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 'DISTINCT(civicrm_participant.id) )  FROM civicrm_contact contact_a LEFT JOIN civ' at line 1]"]
)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • DB Error: syntax error after upgrade from 3.4.8 to 4.1.5 (Drupal 6)

This forum was archived on 2017-11-26.