DatabaseTestCase::testUnion() and DatabaseTestCase::testUnionAll() assume order returned by database
When adding data to a (clean?) MySQL database, the data is returned in the order it is inserted absent an ORDER BY clause in the query. SQL doesn't support ORDER BY in the individual SELECT queries, only at the end covering the entire UNION. The database layer doesn't have a way to add an ORDER BY to the UNION, only the individual SELECT queries.
Two tests, DatabaseTestCase::testUnion() and DatabaseTestCase::testUnionAll() sometimes fail on non-MySQL databases because the data comes back in a different order than expected. Calling sort()
on the results is sufficient to ensure the tests pass.