*/
public void testAdditionalOrderByCases() throws SQLException {
String sql1;
Statement s;
ResultSet rs;
RuntimeStatisticsParser rtsp;
String [][] result;
s = createStatement();
s.execute("call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1)");
sql1 = "select a.col1, b.col2, c.col2 from a, b, c where c.col1=3 " +
"order by a.col1, c.col1";
rs = s.executeQuery(sql1);
rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
assertTrue(rtsp.whatSortingRequired());
rs = s.executeQuery(sql1);
result = new String[][] {
{"1", "2", "3"},{"1", "2", "3"}, {"1", "2", "3"},
{"1", "2", "3"},{"1", "2", "3"}, {"1", "2", "3"},
{"1", "2", "3"},{"1", "2", "3"}};
JDBC.assertFullResultSet(rs, result);
sql1 = "select a.col1, b.col2, c.col2 from a, b, c where a.col1=1 "+
"and b.col1 = 2 and c.col1=3 order by a.col1, b.col1, c.col1";
rs = s.executeQuery(sql1);
rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
assertFalse(rtsp.whatSortingRequired());
rs = s.executeQuery(sql1);
JDBC.assertFullResultSet(rs, result);
sql1 = "select c.col1, b.col1, a.col1 from a, b, c where a.col1=1 "+
"and b.col1 = 2 and c.col1=3 order by c.col1, b.col1, a.col1";
result = new String[][] {
{"3", "2", "1"},{"3", "2", "1"}, {"3", "2", "1"},
{"3", "2", "1"},{"3", "2", "1"}, {"3", "2", "1"},
{"3", "2", "1"},{"3", "2", "1"}};
rs = s.executeQuery(sql1);
rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
assertFalse(rtsp.whatSortingRequired());
rs = s.executeQuery(sql1);
JDBC.assertFullResultSet(rs, result);
sql1 = "select c.col1, b.col1, a.col1 from a, b, c where a.col1=1 "+
"and b.col1 = 2 and c.col1=3 order by c.col2, b.col2, a.col2";
rs = s.executeQuery(sql1);
rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
assertTrue(rtsp.whatSortingRequired());
rs = s.executeQuery(sql1);
JDBC.assertFullResultSet(rs, result);
}