Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.7.27
-
Fix Version/s: 4.7.28
-
Component/s: CiviReport
-
Labels:
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Funding Source:Contributed Code
-
Verified?:No
Description
Steps to replicate:
------------------------
Go to Top Donors report and search for results
Add contacts to any group and you get this error
Database Error Code: Incorrect usage/placement of 'SQL_CALC_FOUND_ROWS', 1234 Additional Details: Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => handle ) [code] => -1 [message] => DB Error: unknown error [mode] => 16 [debug_info] => SELECT * FROM ( SELECT SQL_CALC_FOUND_ROWS contact_civireport.display_name as civicrm_contact_display_name, contact_civireport.id as civicrm_contact_id, SUM(contribution_civireport.total_amount) as civicrm_contribution_total_amount_sum, COUNT(contribution_civireport.total_amount) as civicrm_contribution_total_amount_count, ROUND(AVG(contribution_civireport.total_amount),2) as civicrm_contribution_total_amount_avg, contribution_civireport.currency as civicrm_contribution_currency FROM civicrm_contact contact_civireport INNER JOIN civicrm_contribution contribution_civireport ON contact_civireport.id = contribution_civireport.contact_id AND contribution_civireport.is_test = 0 LEFT JOIN civicrm_email email_civireport ON contact_civireport.id = email_civireport.contact_id AND email_civireport.is_primary = 1 LEFT JOIN civicrm_phone phone_civireport ON contact_civireport.id = phone_civireport.contact_id AND phone_civireport.is_primary = 1 WHERE ( contact_civireport.is_deceased = 0 ) AND ( contact_civireport.is_deleted = 0 ) AND ( receive_date >= 20170101000000 ) AND ( receive_date <= 20171231235959 ) AND ( contribution_civireport.contribution_status_id IN (1) ) GROUP BY contact_civireport.id, contribution_civireport.currency ORDER BY civicrm_contribution_total_amount_sum DESC ) as abc LIMIT 0, 50 [nativecode=1234 ** Incorrect usage/placement of 'SQL_CALC_FOUND_ROWS'] [type] => DB_Error [user_info] => SELECT * FROM ( SELECT SQL_CALC_FOUND_ROWS contact_civireport.display_name as civicrm_contact_display_name, contact_civireport.id as civicrm_contact_id, SUM(contribution_civireport.total_amount) as civicrm_contribution_total_amount_sum, COUNT(contribution_civireport.total_amount) as civicrm_contribution_total_amount_count, ROUND(AVG(contribution_civireport.total_amount),2) as civicrm_contribution_total_amount_avg, contribution_civireport.currency as civicrm_contribution_currency FROM civicrm_contact contact_civireport INNER JOIN civicrm_contribution contribution_civireport ON contact_civireport.id = contribution_civireport.contact_id AND contribution_civireport.is_test = 0 LEFT JOIN civicrm_email email_civireport ON contact_civireport.id = email_civireport.contact_id AND email_civireport.is_primary = 1 LEFT JOIN civicrm_phone phone_civireport ON contact_civireport.id = phone_civireport.contact_id AND phone_civireport.is_primary = 1 WHERE ( contact_civireport.is_deceased = 0 ) AND ( contact_civireport.is_deleted = 0 ) AND ( receive_date >= 20170101000000 ) AND ( receive_date <= 20171231235959 ) AND ( contribution_civireport.contribution_status_id IN (1) ) GROUP BY contact_civireport.id, contribution_civireport.currency ORDER BY civicrm_contribution_total_amount_sum DESC ) as abc LIMIT 0, 50 [nativecode=1234 ** Incorrect usage/placement of 'SQL_CALC_FOUND_ROWS'] [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT * FROM ( SELECT SQL_CALC_FOUND_ROWS contact_civireport.display_name as civicrm_contact_display_name, contact_civireport.id as civicrm_contact_id, SUM(contribution_civireport.total_amount) as civicrm_contribution_total_amount_sum, COUNT(contribution_civireport.total_amount) as civicrm_contribution_total_amount_count, ROUND(AVG(contribution_civireport.total_amount),2) as civicrm_contribution_total_amount_avg, contribution_civireport.currency as civicrm_contribution_currency FROM civicrm_contact contact_civireport INNER JOIN civicrm_contribution contribution_civireport ON contact_civireport.id = contribution_civireport.contact_id AND contribution_civireport.is_test = 0 LEFT JOIN civicrm_email email_civireport ON contact_civireport.id = email_civireport.contact_id AND email_civireport.is_primary = 1 LEFT JOIN civicrm_phone phone_civireport ON contact_civireport.id = phone_civireport.contact_id AND phone_civireport.is_primary = 1 WHERE ( contact_civireport.is_deceased = 0 ) AND ( contact_civireport.is_deleted = 0 ) AND ( receive_date >= 20170101000000 ) AND ( receive_date <= 20171231235959 ) AND ( contribution_civireport.contribution_status_id IN (1) ) GROUP BY contact_civireport.id, contribution_civireport.currency ORDER BY civicrm_contribution_total_amount_sum DESC ) as abc LIMIT 0, 50 [nativecode=1234 ** Incorrect usage/placement of 'SQL_CALC_FOUND_ROWS']"] )