Program: 112433
Project: 112433
Buggy source:
@Test public void testIndexWithDecimalCol() throws Exception {
  Properties props=PropertiesUtil.deepCopy(TEST_PROPERTIES);
  String tableName="String_Node_Str" + generateUniqueName();
  String indexName="String_Node_Str" + generateUniqueName();
  String fullTableName=SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME,tableName);
  String fullIndexName=SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME,indexName);
  try (Connection conn=DriverManager.getConnection(getUrl(),props)){
    conn.setAutoCommit(false);
    String query;
    ResultSet rs;
    Date date=new Date(System.currentTimeMillis());
    TestUtil.createMultiCFTestTable(conn,fullTableName,tableDDLOptions);
    populateMultiCFTestTable(fullTableName,date);
    String ddl=null;
    ddl="String_Node_Str" + (localIndex ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ indexName+ "String_Node_Str"+ fullTableName+ "String_Node_Str";
    PreparedStatement stmt=conn.prepareStatement(ddl);
    stmt.execute();
    query="String_Node_Str" + fullTableName;
    rs=conn.createStatement().executeQuery("String_Node_Str" + query);
    if (localIndex) {
      assertEquals("String_Node_Str" + fullTableName + "String_Node_Str",QueryUtil.getExplainPlan(rs));
    }
 else {
      assertEquals("String_Node_Str" + fullIndexName,QueryUtil.getExplainPlan(rs));
    }
    rs=conn.createStatement().executeQuery(query);
    assertTrue(rs.next());
    assertEquals(new BigDecimal("String_Node_Str"),rs.getBigDecimal(1));
    assertEquals(new BigDecimal("String_Node_Str"),rs.getBigDecimal(2));
    assertEquals(new BigDecimal("String_Node_Str"),rs.getBigDecimal(3));
    assertTrue(rs.next());
    assertEquals(new BigDecimal("String_Node_Str"),rs.getBigDecimal(1));
    assertEquals(new BigDecimal("String_Node_Str"),rs.getBigDecimal(2));
    assertEquals(new BigDecimal("String_Node_Str"),rs.getBigDecimal(3));
    assertTrue(rs.next());
    assertEquals(new BigDecimal("String_Node_Str"),rs.getBigDecimal(1));
    assertEquals(new BigDecimal("String_Node_Str"),rs.getBigDecimal(2));
    assertEquals(new BigDecimal("String_Node_Str"),rs.getBigDecimal(3));
    assertFalse(rs.next());
  }
 }

Fixed version (ground truth):
@Test public void testIndexWithDecimalCol() throws Exception {
  Properties props=PropertiesUtil.deepCopy(TEST_PROPERTIES);
  String tableName="String_Node_Str" + generateUniqueName();
  String indexName="String_Node_Str" + generateUniqueName();
  String fullTableName=SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME,tableName);
  String fullIndexName=SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME,indexName);
  try (Connection conn=DriverManager.getConnection(getUrl(),props)){
    conn.setAutoCommit(false);
    String query;
    ResultSet rs;
    Date date=new Date(System.currentTimeMillis());
    TestUtil.createMultiCFTestTable(conn,fullTableName,tableDDLOptions);
    populateMultiCFTestTable(fullTableName,date);
    String ddl=null;
    ddl="String_Node_Str" + (localIndex ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ indexName+ "String_Node_Str"+ fullTableName+ "String_Node_Str";
    conn.createStatement().execute(ddl);
    query="String_Node_Str" + fullTableName;
    rs=conn.createStatement().executeQuery("String_Node_Str" + query);
    if (localIndex) {
      assertEquals("String_Node_Str" + fullTableName + "String_Node_Str",QueryUtil.getExplainPlan(rs));
    }
 else {
      assertEquals("String_Node_Str" + fullIndexName,QueryUtil.getExplainPlan(rs));
    }
    rs=conn.createStatement().executeQuery(query);
    assertTrue(rs.next());
    assertEquals(new BigDecimal("String_Node_Str"),rs.getBigDecimal(1));
    assertEquals(new BigDecimal("String_Node_Str"),rs.getBigDecimal(2));
    assertEquals(new BigDecimal("String_Node_Str"),rs.getBigDecimal(3));
    assertTrue(rs.next());
    assertEquals(new BigDecimal("String_Node_Str"),rs.getBigDecimal(1));
    assertEquals(new BigDecimal("String_Node_Str"),rs.getBigDecimal(2));
    assertEquals(new BigDecimal("String_Node_Str"),rs.getBigDecimal(3));
    assertTrue(rs.next());
    assertEquals(new BigDecimal("String_Node_Str"),rs.getBigDecimal(1));
    assertEquals(new BigDecimal("String_Node_Str"),rs.getBigDecimal(2));
    assertEquals(new BigDecimal("String_Node_Str"),rs.getBigDecimal(3));
    assertFalse(rs.next());
  }
 }