Status: Waiting for peer review
Affects Version/s: 3.10.4, 3.11
Fix Version/s: None
In Workplace we have a unittest that tests re-enrolment and recovering course grades. This test started failing on MariaDB (on ci.moodle.org and in moodle-docker).
There are no tests for the function grade_recover_history_grades() in Moodle LMS.
To be honest I don't understand what exactly is happening - why did it suddenly start falling now and why the current SQL query does not work on mariadb (by "does not work" I mean that this query was returning empty array in mariadb)
But what I can do is to add the same unittest to Moodle LMS and change the SQL query so it works on all dbs.
from the attached solution take only the unittest and run it on different DB engines on ci.moodle.org or in moodle-docker - it will work on postgres/mysql/oracle/mssql but will fail on mariadb.