5
« on: June 19, 2020, 12:50:15 PM »
Hi
I had the same error after MySQL got upgraded to a new version. The cause for this error is an invalid view "v_flights_pilots".
You have to delete it and recreate it using the following SQL command:
CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `v_flights_pilots` AS select count(`reports`.`report_id`) AS `c`,date_format(`reports`.`date`,'%Y-%m-%d') AS `flightdate`,`reports`.`pilot_id` AS `pilot`,'fsacars' AS `type` from `reports` group by `reports`.`pilot_id`,`reports`.`date` union select count(`pireps`.`pirep_id`) AS `c`,date_format(`pireps`.`date`,'%Y-%m-%d') AS `flightdate`,`pireps`.`gvauser_id` AS `pilot`,'manual' AS `type` from `pireps` group by `pireps`.`gvauser_id`,`pireps`.`date` union select count(`pirepfsfk`.`pirepfsfk_id`) AS `c`,date_format(`pirepfsfk`.`CreatedOn`,'%Y-%m-%d') AS `flightdate`,`pirepfsfk`.`gvauser_id` AS `pilot`,'fskeeper' AS `type` from `pirepfsfk` group by `pirepfsfk`.`pirepfsfk_id`,`pirepfsfk`.`CreatedOn` union select count(`vampireps`.`flightid`) AS `c`,date_format(`vampireps`.`flight_date`,'%Y-%m-%d') AS `flightdate`,`vampireps`.`gvauser_id` AS `pilot`,'vamkeeper' AS `type` from `vampireps` group by `vampireps`.`gvauser_id`,date_format(`vampireps`.`flight_date`,'%Y-%m-%d');
With sql_mode=only_full_group_by the GROUP BY statement must contain all fields not using an aggregate function.