Closed gonzad26 closed 6 years ago
Thanks for catching this and bringing it up. There was some unneeded usage of SELECT DISTINCT in MatchRepository which triggers an exception specific for MySQL 5.7 and later. I guess we've tested this on older versions only. Now it's removed and issue is solved. Pull and try again.
Thanks for the fix! It's an excelent idea for a game. It was developed very well and the code is very understandable.
When i try to edit matches, it throws an sql exception I have some teams loaded with the API but no matches yet.
Exception:
` [1] Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'SELECT DISTINCT m0_.id AS id0, m0.datetime AS datetime1, m0.home_goals AS home_goals2, m0.away_goals AS away_goals3, m0.notification_sent AS notification_sent4, m0.home_team_id AS home_team_id5, m0.away_team_id AS away_team_id6, m0.tournament_id AS tournament_id7 FROM matches m0 INNER JOIN teams t1 ON m0.home_teamid = t1.id WHERE m0_.tournamentid = ? AND (m0.datetime >= ? AND m0.datetime <= ?) ORDER BY m0.datetime ASC, t1_.name ASC' with params [1, "2018-05-16", "2018-05-31"]:
SQLSTATE[HY000]: General error: 3065 Expression #2 of ORDER BY clause is not in SELECT list, references column 'prodewnpprodetest.t1.name' which is not in SELECT list; this is incompatible with DISTINCT at n/a in /home/prodewnp/public_html/sportify/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 115
SQLSTATE[HY000]: General error: 3065 Expression #2 of ORDER BY clause is not in SELECT list, references column 'prodewnpprodetest.t1.name' which is not in SELECT list; this is incompatible with DISTINCT', object(PDOException)) in /home/prodewnp/public_html/sportify/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 116
[2] Doctrine\DBAL\Driver\PDOException: SQLSTATE[HY000]: General error: 3065 Expression #2 of ORDER BY clause is not in SELECT list, references column 'prodewnpprodetest.t1.name' which is not in SELECT list; this is incompatible with DISTINCT at n/a in /home/prodewnp/public_html/sportify/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php line 93
[3] PDOException: SQLSTATE[HY000]: General error: 3065 Expression #2 of ORDER BY clause is not in SELECT list, references column 'prodewnpprodetest.t1.name' which is not in SELECT list; this is incompatible with DISTINCT at n/a in /home/prodewnp/public_html/sportify/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php line 91