Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-21582

Contribution Detail Report fails with FULL_GROUP_BY on Mysql 5.7

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7.29
    • Fix Version/s: 5.2
    • Component/s: CiviReport
    • Labels:
      None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code
    • Verified?:
      No

      Description

      Contribution Detail Report fails in what appears to be all report configurations.  Backtrace/error follow.

      I didn't dig deeply (I picked this as a random report to screenshot the "Developer" tab for some docs) - but it seems like the "Amount" field, which is required, pulls in the soft credit amount without grouping by it.  I'm not 100% sure the soft credit amount even needs to be brought in here, but that's a separate issue.

       

      backTrace
      
      #0 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/Error.php(187): CRM_Core_Error::backtrace()
      #1 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/packages/PEAR.php(921): CRM_Core_Error::handle(Object(DB_Error))
      #2 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), "CREATE TEMPORARY TABLE civireport_contribution_detail_temp2  DEFAULT CHARACTE...")
      #3 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/packages/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), "CREATE TEMPORARY TABLE civireport_contribution_detail_temp2  DEFAULT CHARACTE...")
      #4 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/packages/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -1, 16, (Array:2), "CREATE TEMPORARY TABLE civireport_contribution_detail_temp2  DEFAULT CHARACTE...", "DB_Error", TRUE)
      #5 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->__call("raiseError", (Array:7))
      #6 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-1, NULL, NULL, "CREATE TEMPORARY TABLE civireport_contribution_detail_temp2  DEFAULT CHARACTE...", "1055 ** Expression #9 of SELECT list is not in GROUP BY clause and contains n...")
      #7 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
      #8 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("CREATE TEMPORARY TABLE civireport_contribution_detail_temp2  DEFAULT CHARACTE...")
      #9 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/packages/DB/DataObject.php(2446): DB_common->query("CREATE TEMPORARY TABLE civireport_contribution_detail_temp2  DEFAULT CHARACTE...")
      #10 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/packages/DB/DataObject.php(1635): DB_DataObject->_query("CREATE TEMPORARY TABLE civireport_contribution_detail_temp2  DEFAULT CHARACTE...")
      #11 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/DAO.php(386): DB_DataObject->query("CREATE TEMPORARY TABLE civireport_contribution_detail_temp2  DEFAULT CHARACTE...")
      #12 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/DAO.php(1335): CRM_Core_DAO->query("CREATE TEMPORARY TABLE civireport_contribution_detail_temp2  DEFAULT CHARACTE...", TRUE)
      #13 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Report/Form/Contribute/Detail.php(547): CRM_Core_DAO::executeQuery("CREATE TEMPORARY TABLE civireport_contribution_detail_temp2  DEFAULT CHARACTE...")
      #14 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/Form.php(447): CRM_Report_Form_Contribute_Detail->postProcess()
      #15 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Submit.php(74): CRM_Core_Form->mainProcess()
      #16 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Submit->perform(Object(CRM_Report_Form_Contribute_Detail), "submit")
      #17 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Report_Form_Contribute_Detail), "submit")
      #18 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("submit")
      #19 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run()
      #20 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Report/Page/Instance.php(89): CRM_Utils_Wrapper->run("CRM_Report_Form_Contribute_Detail", NULL, (Array:0))
      #21 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/Invoke.php(309): CRM_Report_Page_Instance->run((Array:4), NULL)
      #22 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:14))
      #23 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
      #24 /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/drupal/civicrm.module(448): CRM_Core_Invoke::invoke((Array:4))
      #25 /home/jon/local/civicrm-buildkit/build/dmaster/includes/menu.inc(527): civicrm_invoke("report", "instance", "8")
      #26 /home/jon/local/civicrm-buildkit/build/dmaster/index.php(21): menu_execute_active_handler()
      #27 {main}
      
      
      Database Error Code: Expression #9 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'dmasterciv_3kx3n.contribution_soft_civireport.amount' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by, 1055
      Additional Details:
      
      Array
      (
          [callback] => Array
              (
                  [0] => CRM_Core_Error
                  [1] => handle
              )
      
          [code] => -1
          [message] => DB Error: unknown error
          [mode] => 16
          [debug_info] => CREATE TEMPORARY TABLE civireport_contribution_detail_temp2  DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci AS SELECT SQL_CALC_FOUND_ROWS contact_civireport.sort_name as civicrm_contact_sort_name, contact_civireport.id as civicrm_contact_id, email_civireport.email as civicrm_email_email, phone_civireport.phone as civicrm_phone_phone, contribution_civireport.id as civicrm_contribution_contribution_id, contribution_civireport.financial_type_id as civicrm_contribution_financial_type_id, contribution_civireport.currency as civicrm_contribution_currency, contribution_civireport.receive_date as civicrm_contribution_receive_date, contribution_soft_civireport.amount as civicrm_contribution_total_amount, 'Soft Credit' as civicrm_contribution_contribution_or_soft, address_civireport.country_id as civicrm_address_country_id  
            FROM  civireport_contribution_detail_temp1 temp1_civireport
            INNER JOIN civicrm_contribution contribution_civireport
              ON temp1_civireport.civicrm_contribution_contribution_id = contribution_civireport.id
            INNER JOIN civicrm_contribution_soft contribution_soft_civireport
              ON contribution_soft_civireport.contribution_id = contribution_civireport.id
            INNER JOIN civicrm_contact      contact_civireport
              ON contact_civireport.id = contribution_soft_civireport.contact_id
            
          
            LEFT JOIN civicrm_phone phone_civireport
            ON (contact_civireport.id =
            phone_civireport.contact_id) AND
            phone_civireport.is_primary = 1
      
                       LEFT JOIN civicrm_address address_civireport
                                 ON (contact_civireport.id =
                                     address_civireport.contact_id) AND
                                     address_civireport.is_primary = 1
      
                  LEFT JOIN civicrm_email email_civireport
                         ON contact_civireport.id = email_civireport.contact_id AND
                            email_civireport.is_primary = 1
       WHERE (1) AND ( contribution_civireport.contribution_status_id IN (1) )  GROUP BY contact_civireport.id, contribution_civireport.id, email_civireport.email, phone_civireport.phone, 'Contribution', address_civireport.country_id [nativecode=1055 ** Expression #9 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'dmasterciv_3kx3n.contribution_soft_civireport.amount' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by]
          [type] => DB_Error
          [user_info] => CREATE TEMPORARY TABLE civireport_contribution_detail_temp2  DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci AS SELECT SQL_CALC_FOUND_ROWS contact_civireport.sort_name as civicrm_contact_sort_name, contact_civireport.id as civicrm_contact_id, email_civireport.email as civicrm_email_email, phone_civireport.phone as civicrm_phone_phone, contribution_civireport.id as civicrm_contribution_contribution_id, contribution_civireport.financial_type_id as civicrm_contribution_financial_type_id, contribution_civireport.currency as civicrm_contribution_currency, contribution_civireport.receive_date as civicrm_contribution_receive_date, contribution_soft_civireport.amount as civicrm_contribution_total_amount, 'Soft Credit' as civicrm_contribution_contribution_or_soft, address_civireport.country_id as civicrm_address_country_id  
            FROM  civireport_contribution_detail_temp1 temp1_civireport
            INNER JOIN civicrm_contribution contribution_civireport
              ON temp1_civireport.civicrm_contribution_contribution_id = contribution_civireport.id
            INNER JOIN civicrm_contribution_soft contribution_soft_civireport
              ON contribution_soft_civireport.contribution_id = contribution_civireport.id
            INNER JOIN civicrm_contact      contact_civireport
              ON contact_civireport.id = contribution_soft_civireport.contact_id
            
          
            LEFT JOIN civicrm_phone phone_civireport
            ON (contact_civireport.id =
            phone_civireport.contact_id) AND
            phone_civireport.is_primary = 1
      
                       LEFT JOIN civicrm_address address_civireport
                                 ON (contact_civireport.id =
                                     address_civireport.contact_id) AND
                                     address_civireport.is_primary = 1
      
                  LEFT JOIN civicrm_email email_civireport
                         ON contact_civireport.id = email_civireport.contact_id AND
                            email_civireport.is_primary = 1
       WHERE (1) AND ( contribution_civireport.contribution_status_id IN (1) )  GROUP BY contact_civireport.id, contribution_civireport.id, email_civireport.email, phone_civireport.phone, 'Contribution', address_civireport.country_id [nativecode=1055 ** Expression #9 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'dmasterciv_3kx3n.contribution_soft_civireport.amount' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by]
          [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="CREATE TEMPORARY TABLE civireport_contribution_detail_temp2  DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci AS SELECT SQL_CALC_FOUND_ROWS contact_civireport.sort_name as civicrm_contact_sort_name, contact_civireport.id as civicrm_contact_id, email_civireport.email as civicrm_email_email, phone_civireport.phone as civicrm_phone_phone, contribution_civireport.id as civicrm_contribution_contribution_id, contribution_civireport.financial_type_id as civicrm_contribution_financial_type_id, contribution_civireport.currency as civicrm_contribution_currency, contribution_civireport.receive_date as civicrm_contribution_receive_date, contribution_soft_civireport.amount as civicrm_contribution_total_amount, 'Soft Credit' as civicrm_contribution_contribution_or_soft, address_civireport.country_id as civicrm_address_country_id  
            FROM  civireport_contribution_detail_temp1 temp1_civireport
            INNER JOIN civicrm_contribution contribution_civireport
              ON temp1_civireport.civicrm_contribution_contribution_id = contribution_civireport.id
            INNER JOIN civicrm_contribution_soft contribution_soft_civireport
              ON contribution_soft_civireport.contribution_id = contribution_civireport.id
            INNER JOIN civicrm_contact      contact_civireport
              ON contact_civireport.id = contribution_soft_civireport.contact_id
            
          
            LEFT JOIN civicrm_phone phone_civireport
            ON (contact_civireport.id =
            phone_civireport.contact_id) AND
            phone_civireport.is_primary = 1
      
                       LEFT JOIN civicrm_address address_civireport
                                 ON (contact_civireport.id =
                                     address_civireport.contact_id) AND
                                     address_civireport.is_primary = 1
      
                  LEFT JOIN civicrm_email email_civireport
                         ON contact_civireport.id = email_civireport.contact_id AND
                            email_civireport.is_primary = 1
       WHERE (1) AND ( contribution_civireport.contribution_status_id IN (1) )  GROUP BY contact_civireport.id, contribution_civireport.id, email_civireport.email, phone_civireport.phone, 'Contribution', address_civireport.country_id [nativecode=1055 ** Expression #9 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'dmasterciv_3kx3n.contribution_soft_civireport.amount' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by]"]
      )
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              palantejon Jon K Goldberg
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: