Closed kristian-94 closed 3 years ago
There is an API $DB->delete_with_subquery in supported Moodle point versions which should probably be used for these (although the slow get-id-list-then-delete-it approach still also works obviosuly). The new API works properly on Postgres and in a weird way on mysql.
This sql here: https://github.com/moodleou/moodle-mod_oublog/blob/master/classes/task/cron_task.php#L77 Will not work with mysql. MySQL doesn't allow using the table you're deleting from in the WHERE clause.
We should use
get_in_or_equal