SQL for check course context paths (for MariaDB 10.2.2)
This code require supporting WITH statements and granted SUPER privilege for creating db function
Table mdl_course_index_contexts contain course context paths with error flag and new correct path