Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-16353

Query error: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP in mysql strict mode

    XMLWordPrintable

Details

    Description

      Gets following query error when mysql is in strict mode, so probably same on postgres:
      Query error (1140): Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause. Query: SELECT count( * ) AS count
      FROM ezfind_elevate_configuration WHERE contentobject_id='138' ORDER BY contentobject_id ASC

      Here is a patch that solves the issue for me at least by using persistentObject's count method instead of custom code:

      Index: extension/ezfind/classes/ezfindelevateconfiguration.php
      ===================================================================
      --- extension/ezfind/classes/ezfindelevateconfiguration.php	(revision 4475)
      +++ extension/ezfind/classes/ezfindelevateconfiguration.php	(working copy)
      @@ -176,15 +176,6 @@
               $results = array();
               $sortClause = $groupByLanguage ? array( 'language_code' => 'asc' ) : null;
       
      -        if ( $countOnly )
      -        {
      -            $limit = null;
      -            $asObject = false;
      -            $fieldFilters = array();
      -            $custom = array( array( 'operation' => 'count( * )',
      -                                    'name' => 'count' ) );
      -        }
      -
               $conds = array( 'contentobject_id' => $objectID );
               if ( $languageCode and $languageCode !== '' )
                   $conds['language_code'] = array( array( $languageCode, self::WILDCARD ) );
      @@ -201,14 +192,13 @@
                   }
               }
       
      -        $rows = parent::fetchObjectList( self::definition(), $fieldFilters, $conds, $sortClause, $limit, $asObject, false, $custom );
      -
               if ( $countOnly )
               {
      -            return $rows[0]['count'];
      +            return parent::count( self::definition(), $conds );
               }
               else
               {
      +            $rows = parent::fetchObjectList( self::definition(), $fieldFilters, $conds, $sortClause, $limit, $asObject, false, $custom );
                   foreach( $rows as $row )
                   {
                       if ( $groupByLanguage )
      

      Attachments

        Activity

          People

            pborgerm pborgerm
            andre1 andre1
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: