MDL-7376 the isNameInUse($object_name, $type) was introduced for PostgreSQL, MS-SQL and Oracle to avoid generating duplicate names when creating DB objects.
This check was skipped for MySQL, because in that DB, indexes "belong" to tables, so it's possible to have "duplicates" belonging to different tables.
But duplicates can, also, happen in the same tables. One proof:
- We have table XXX, with one index over the userid field. It will be named: XXX_use_ix.
- We add one new field, username, and try to create one index over it: XXX_use_ix will be used too. Conflict!!
So, it's required to implement the isNameInUse() function for MySQL.