Program: 112422
Project: 112422
Buggy source:
protected void helpTestDeleteIndexedExpression(boolean mutable,boolean localIndex) throws Exception {
  String dataTableName=generateUniqueName();
  String fullDataTableName=INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + dataTableName;
  String indexName=generateUniqueName();
  String fullIndexTableName=INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + indexName;
  Properties props=PropertiesUtil.deepCopy(TEST_PROPERTIES);
  Connection conn=DriverManager.getConnection(getUrl(),props);
  try {
    conn.setAutoCommit(false);
    createDataTable(conn,fullDataTableName,mutable ? "String_Node_Str" : "String_Node_Str");
    populateDataTable(conn,fullDataTableName);
    String ddl="String_Node_Str" + (localIndex ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ indexName+ "String_Node_Str"+ fullDataTableName+ "String_Node_Str";
    PreparedStatement stmt=conn.prepareStatement(ddl);
    stmt.execute();
    ResultSet rs;
    rs=conn.createStatement().executeQuery("String_Node_Str" + fullDataTableName);
    assertTrue(rs.next());
    assertEquals(2,rs.getInt(1));
    rs=conn.createStatement().executeQuery("String_Node_Str" + fullIndexTableName);
    assertTrue(rs.next());
    assertEquals(2,rs.getInt(1));
    conn.setAutoCommit(true);
    String dml="String_Node_Str" + fullDataTableName + "String_Node_Str";
    try {
      conn.createStatement().execute(dml);
      if (!mutable) {
        fail();
      }
    }
 catch (    SQLException e) {
      if (!mutable) {
        assertEquals(SQLExceptionCode.INVALID_FILTER_ON_IMMUTABLE_ROWS.getErrorCode(),e.getErrorCode());
      }
    }
    if (!mutable) {
      dml="String_Node_Str" + fullDataTableName + "String_Node_Str";
      conn.createStatement().execute(dml);
    }
    rs=conn.createStatement().executeQuery("String_Node_Str" + fullDataTableName);
    assertTrue(rs.next());
    assertEquals(1,rs.getInt(1));
    rs=conn.createStatement().executeQuery("String_Node_Str" + fullIndexTableName);
    assertTrue(rs.next());
    assertEquals(1,rs.getInt(1));
    conn.createStatement().execute("String_Node_Str" + indexName + "String_Node_Str"+ fullDataTableName);
  }
  finally {
    conn.close();
  }
}

Fixed version (ground truth):
protected void helpTestDeleteIndexedExpression(boolean mutable,boolean localIndex) throws Exception {
  String dataTableName=generateUniqueName();
  String fullDataTableName=INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + dataTableName;
  String indexName=generateUniqueName();
  String fullIndexTableName=INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + indexName;
  Properties props=PropertiesUtil.deepCopy(TEST_PROPERTIES);
  Connection conn=DriverManager.getConnection(getUrl(),props);
  try {
    conn.setAutoCommit(false);
    createDataTable(conn,fullDataTableName,mutable ? "String_Node_Str" : "String_Node_Str");
    populateDataTable(conn,fullDataTableName);
    String ddl="String_Node_Str" + (localIndex ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ indexName+ "String_Node_Str"+ fullDataTableName+ "String_Node_Str";
    conn.createStatement().execute(ddl);
    ResultSet rs;
    rs=conn.createStatement().executeQuery("String_Node_Str" + fullDataTableName);
    assertTrue(rs.next());
    assertEquals(2,rs.getInt(1));
    rs=conn.createStatement().executeQuery("String_Node_Str" + fullIndexTableName);
    assertTrue(rs.next());
    assertEquals(2,rs.getInt(1));
    conn.setAutoCommit(true);
    String dml="String_Node_Str" + fullDataTableName + "String_Node_Str";
    try {
      conn.createStatement().execute(dml);
      if (!mutable) {
        fail();
      }
    }
 catch (    SQLException e) {
      if (!mutable) {
        assertEquals(SQLExceptionCode.INVALID_FILTER_ON_IMMUTABLE_ROWS.getErrorCode(),e.getErrorCode());
      }
    }
    if (!mutable) {
      dml="String_Node_Str" + fullDataTableName + "String_Node_Str";
      conn.createStatement().execute(dml);
    }
    rs=conn.createStatement().executeQuery("String_Node_Str" + fullDataTableName);
    assertTrue(rs.next());
    assertEquals(1,rs.getInt(1));
    rs=conn.createStatement().executeQuery("String_Node_Str" + fullIndexTableName);
    assertTrue(rs.next());
    assertEquals(1,rs.getInt(1));
    conn.createStatement().execute("String_Node_Str" + indexName + "String_Node_Str"+ fullDataTableName);
  }
  finally {
    conn.close();
  }
}