
issue: running the below query works fine on version 5.6. crashes mysqld process on version 5.7.2_m12-14.
import data: myproviewer_export.sql
query:

SELECT
    MediaId, Trim(Url) as Url, CreateDate, CompanyId, Enabled, MetaData, IsNew, StartMonth, StartDay, EndMonth, EndDay, IsContinuous, IsScheduled, ScheduleString
FROM (
 	SELECT
 		MediaId, Url, CreateDate, CompanyId, Enabled, MetaData, IsNew, StartMonth, StartDay, EndMonth, EndDay, IsContinuous, IsScheduled, ScheduleString, CONCAT('|',GROUP_CONCAT(TagId SEPARATOR '|'),'|') AS ids
 	FROM (
  		SELECT DISTINCT
            Media.MediaId as MediaId,
            Concat('http://localhost/repository/', Media.Url) as Url,
            Media.CreateDate as CreateDate,
            Media.CompanyId as CompanyId,
                        Media.Enabled as Enabled,
            Media.MetaData as MetaData,
            MediaTags.TagId,
            CASE WHEN Media.CreateDate > DATE_SUB(NOW(), INTERVAL 60 DAY) THEN
             '1'
            ELSE
             '0'
            END as IsNew,
            MediaSchedules.StartMonth,
            MediaSchedules.StartDay,
            MediaSchedules.EndMonth,
            MediaSchedules.EndDay,
            CASE WHEN MediaSchedules.StartMonth = 0 AND MediaSchedules.StartDay = 0 AND MediaSchedules.EndMonth = 0 AND MediaSchedules.EndDay = 0  THEN
             '1'
            ELSE
             '0'
            END as IsContinuous,
            CASE WHEN MediaSchedules.StartMonth != 0 AND MediaSchedules.StartDay != 0 AND MediaSchedules.EndMonth != 0 AND MediaSchedules.EndDay != 0  THEN
             '1'
            ELSE
             '0'
            END as IsScheduled,
            concat(DATE_FORMAT(STR_TO_DATE(concat(MediaSchedules.StartMonth,'/',MediaSchedules.StartDay,'/',2014), '%m/%d/%Y') , '%b %e'), ' - ', DATE_FORMAT(STR_TO_DATE(concat(MediaSchedules.EndMonth,'/',MediaSchedules.EndDay,'/',2014), '%m/%d/%Y') , '%b %e') ) as ScheduleString
         FROM
          Media LEFT JOIN MediaSchedules ON MediaSchedules.MediaId = Media.MediaId, MediaTags, Tag
         WHERE
          MediaTags.MediaId = Media.MediaId
          AND MediaTags.TagId = Tag.TagId
          AND Tag.TagId IN (
                  109, 73
              ) 
         ORDER BY
          CreateDate DESC
			 ) a
    WHERE  
      ( IsContinuous = '0' AND IsScheduled = '0' ) 
    GROUP BY
      MediaId, Url, CreateDate, CompanyId, Enabled, MetaData, IsNew, StartMonth, StartDay, EndMonth, EndDay, IsContinuous, IsScheduled, ScheduleString
    ) b
WHERE  
    Ids LIKE '%|109|%'  AND Ids NOT LIKE '%|73|%'
LIMIT 0, 50

