If I have read the patch correctly, DistinctTest.checkDistinctRows only tests that the queries return the correct number of rows. Are we confident that the other aspects of SELECT DISTINCT (for instance that the returned values in fact are distinct and the ones we expect) are tested well enough by other tests?
What I do like about the approach is that the test doesn't fail if the order of the rows changes, since I am planning to post a patch for
DERBY-2493 which will change the order.
Some tiny nits:
- checkDistinctRows() could be private, I think
- in checkDistinctRows(), "if (rowcounts.length != 37) fail(...)" could be changed to assertEquals
- in javadoc for RuntimeStatisticsParser.indexOf(): "founf" -> "found"