MDL-33172 - filestorage: Fix oracle incompatibilites
MDL-33172 - filestorage: Fix oracle incompatibilites

Fixes the following problems:

* When we select from two tables with the same named fields (id)
  and ask to sort by that field, Oracle doesn't know which table to
  sort frm unless that field is named in the SELECT. Here we do that
  by explicitly naming the fields. This keeps compatibility with before
  the reference table was added.

* Text comparisong without sql_compare_text

dilawar/moodle