Fixes for mariadb support.
MariaDB optimizes out order by clauses on subqueries where the enclosing query is essentially a
select * from ( ... ), which breaks show support in some cases.  Arrange to put order by clauses on
the view query, rather than on the definition of the view query.

Making ordering explicit in some tests.