After upgrade to 5.4.0 (from 4.7) I'm seeing fatal DB errors ("no such field") when refreshing Contribution Detail & Summary reports. Debug log shows:
$Fatal Error Details = Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => handle ) [code] => -19 [message] => DB Error: no such field [mode] => 16 [debug_info] => SELECT ifnull(civicrm_contribution_financial_type_id, '') as civicrm_contribution_financial_type_id, ifnull(civicrm_contribution_payment_instrument_id, '') as civicrm_contribution_payment_instrument_id, ifnull(civicrm_contact_sort_name, '') as civicrm_contact_sort_name, ifnull(civicrm_contact_id, '') as civicrm_contact_id, ifnull(civicrm_contribution_contribution_id, '') as civicrm_contribution_contribution_id, ifnull(civicrm_contribution_financial_type_id, '') as civicrm_contribution_financial_type_id, ifnull(civicrm_contribution_payment_instrument_id, '') as civicrm_contribution_payment_instrument_id, ifnull(civicrm_contribution_currency, '') as civicrm_contribution_currency, ifnull(civicrm_contribution_receive_date, '') as civicrm_contribution_receive_date, ifnull(civicrm_contribution_total_amount, '') as civicrm_contribution_total_amount, ifnull(civicrm_contribution_fee_amount, '') as civicrm_contribution_fee_amount, ifnull(civicrm_contribution_net_amount, '') as civicrm_contribution_net_amount, ifnull(civicrm_contribution_contribution_or_soft, '') as civicrm_contribution_contribution_or_soft, ifnull(civicrm_contribution_campaign_id, '') as civicrm_contribution_campaign_id, ifnull(civicrm_value_gift_aid_declaration_custom_25, '') as civicrm_value_gift_aid_declaration_custom_25, ifnull(civicrm_value_gift_aid_declaration_custom_26, '') as civicrm_value_gift_aid_declaration_custom_26, ifnull(civicrm_value_gift_aid_declaration_custom_27, '') as civicrm_value_gift_aid_declaration_custom_27 , sum(civicrm_contribution_total_amount) as sumcontribs, count(*) as ct from civireport_contribution_detail_temp3 group by civicrm_contribution_financial_type_id, civicrm_contribution_payment_instrument_id [nativecode=1054 ** Unknown column 'civicrm_contribution_total_amount' in 'field list'] [type] => DB_Error [user_info] => SELECT ifnull(civicrm_contribution_financial_type_id, '') as civicrm_contribution_financial_type_id, ifnull(civicrm_contribution_payment_instrument_id, '') as civicrm_contribution_payment_instrument_id, ifnull(civicrm_contact_sort_name, '') as civicrm_contact_sort_name, ifnull(civicrm_contact_id, '') as civicrm_contact_id, ifnull(civicrm_contribution_contribution_id, '') as civicrm_contribution_contribution_id, ifnull(civicrm_contribution_financial_type_id, '') as civicrm_contribution_financial_type_id, ifnull(civicrm_contribution_payment_instrument_id, '') as civicrm_contribution_payment_instrument_id, ifnull(civicrm_contribution_currency, '') as civicrm_contribution_currency, ifnull(civicrm_contribution_receive_date, '') as civicrm_contribution_receive_date, ifnull(civicrm_contribution_total_amount, '') as civicrm_contribution_total_amount, ifnull(civicrm_contribution_fee_amount, '') as civicrm_contribution_fee_amount, ifnull(civicrm_contribution_net_amount, '') as civicrm_contribution_net_amount, ifnull(civicrm_contribution_contribution_or_soft, '') as civicrm_contribution_contribution_or_soft, ifnull(civicrm_contribution_campaign_id, '') as civicrm_contribution_campaign_id, ifnull(civicrm_value_gift_aid_declaration_custom_25, '') as civicrm_value_gift_aid_declaration_custom_25, ifnull(civicrm_value_gift_aid_declaration_custom_26, '') as civicrm_value_gift_aid_declaration_custom_26, ifnull(civicrm_value_gift_aid_declaration_custom_27, '') as civicrm_value_gift_aid_declaration_custom_27 , sum(civicrm_contribution_total_amount) as sumcontribs, count(*) as ct from civireport_contribution_detail_temp3 group by civicrm_contribution_financial_type_id, civicrm_contribution_payment_instrument_id [nativecode=1054 ** Unknown column 'civicrm_contribution_total_amount' in 'field list'] [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT ifnull(civicrm_contribution_financial_type_id, '') as civicrm_contribution_financial_type_id, ifnull(civicrm_contribution_payment_instrument_id, '') as civicrm_contribution_payment_instrument_id, ifnull(civicrm_contact_sort_name, '') as civicrm_contact_sort_name, ifnull(civicrm_contact_id, '') as civicrm_contact_id, ifnull(civicrm_contribution_contribution_id, '') as civicrm_contribution_contribution_id, ifnull(civicrm_contribution_financial_type_id, '') as civicrm_contribution_financial_type_id, ifnull(civicrm_contribution_payment_instrument_id, '') as civicrm_contribution_payment_instrument_id, ifnull(civicrm_contribution_currency, '') as civicrm_contribution_currency, ifnull(civicrm_contribution_receive_date, '') as civicrm_contribution_receive_date, ifnull(civicrm_contribution_total_amount, '') as civicrm_contribution_total_amount, ifnull(civicrm_contribution_fee_amount, '') as civicrm_contribution_fee_amount, ifnull(civicrm_contribution_net_amount, '') as civicrm_contribution_net_amount, ifnull(civicrm_contribution_contribution_or_soft, '') as civicrm_contribution_contribution_or_soft, ifnull(civicrm_contribution_campaign_id, '') as civicrm_contribution_campaign_id, ifnull(civicrm_value_gift_aid_declaration_custom_25, '') as civicrm_value_gift_aid_declaration_custom_25, ifnull(civicrm_value_gift_aid_declaration_custom_26, '') as civicrm_value_gift_aid_declaration_custom_26, ifnull(civicrm_value_gift_aid_declaration_custom_27, '') as civicrm_value_gift_aid_declaration_custom_27 , sum(civicrm_contribution_total_amount) as sumcontribs, count(*) as ct from civireport_contribution_detail_temp3 group by civicrm_contribution_financial_type_id, civicrm_contribution_payment_instrument_id [nativecode=1054 ** Unknown column 'civicrm_contribution_total_amount' in 'field list']"] )
Key issue seems to be that civicrm_contribution_total_amount is not included in temp table civireport_contribution_detail_temp3
Checked on a 5.0 demo site listed on civicrm.org (https://drupal.demo.civicrmfr.org/civicrm/report/list?compid=2&reset=1 - the only one running 5.x) and get the same error.
Any help gratefully received...