// distinct is executed. So test by retrieving data into a temp table and
// return results ordered after making sure the query was executed as expected
s.execute("create table temp_result (c2 int, c3 int)");
s.execute("insert into temp_result select distinct c2, c3 from two");
rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
assertTrue(rtsp.usedDistinctScan());
// Try same query, but with an order by at the end. This will use the sort for
// the "order by" to do the distinct and not do a "DISTINCT SCAN".
assertRowCount(3, s.executeQuery("select distinct c2, c3 from two order by c2, c3"));
rtsp = SQLUtilities.getRuntimeStatisticsParser(s);