public static void configDiff(String config) throws Exception {
if ( ! setUp( config )) {
return;
}
m_reportWriter.write( "===================================================================Begin "+config+"\n" );
PlanNodeTree pnt1 = null;
PlanNodeTree pnt2 = null;
int size = m_stmts.size();
String baseStmt = null;
for( int i = 0; i < size; i++ ){
//* Enable for debug:*/ System.out.println("DEBUG: comparing " + m_savePlanPath+config+".plan"+i + " and " + m_baselinePath+config+".plan"+i);
ArrayList<String> getsql = new ArrayList<String>();
try {
pnt1 = loadPlanFromFile( m_baselinePath+config+".plan"+i, getsql );
baseStmt = getsql.get(0);
} catch (FileNotFoundException e) {
String message = "ERROR: Plan file "+m_baselinePath+config+".plan"+i+" doesn't exist. Use -s (the Compile/Save option) or 'ant plannertestrefresh -Dconfig="+config + " ' to generate plans to the baseline directory.\n";
System.err.print(message);
m_reportWriter.write(message);
System.exit(1);
}
//if sql stmts not consistent
if( !baseStmt.equalsIgnoreCase( m_stmts.get(i)) ) {
diffPair strPair = new diffPair( baseStmt, m_stmts.get(i) );
m_reportWriter.write("Statement "+i+" of "+config+"/config:\n SQL statement is not consistent with the one in baseline :"+"\n"+
strPair.toString()+"\n");
m_numFail++;
continue;
}
try{
pnt2 = loadPlanFromFile( m_workPath+config+".plan"+i, getsql );
} catch (FileNotFoundException e) {
String message = "ERROR: Temporary plan file "+m_workPath+config+".plan"+i+" was not generated.\n";
System.err.print(message);
m_reportWriter.write(message);
System.exit(1);
}
AbstractPlanNode pn1 = pnt1.getRootPlanNode();
AbstractPlanNode pn2 = pnt2.getRootPlanNode();
if( diff( pn1, pn2, false ) ) {
m_numPass++;
if( m_reportExplainedPlan ) {