Program: 3526
Project: 3526
Buggy source:
@Test public void columnOrderOfgetPrimaryKeys() throws SQLException {
  ResultSet rs;
  ResultSetMetaData rsmeta;
  stat.executeUpdate("String_Node_Str");
  stat.executeUpdate("String_Node_Str");
  stat.executeUpdate("String_Node_Str");
  stat.executeUpdate("String_Node_Str");
  stat.executeUpdate("String_Node_Str" + "String_Node_Str");
  rs=meta.getPrimaryKeys(null,null,"String_Node_Str");
  assertFalse(rs.next());
  rsmeta=rs.getMetaData();
  assertEquals(rsmeta.getColumnCount(),6);
  assertEquals(rsmeta.getColumnName(1),"String_Node_Str");
  assertEquals(rsmeta.getColumnName(2),"String_Node_Str");
  assertEquals(rsmeta.getColumnName(3),"String_Node_Str");
  assertEquals(rsmeta.getColumnName(4),"String_Node_Str");
  assertEquals(rsmeta.getColumnName(5),"String_Node_Str");
  assertEquals(rsmeta.getColumnName(6),"String_Node_Str");
  rs.close();
  rs=meta.getPrimaryKeys(null,null,"String_Node_Str");
  assertTrue(rs.next());
  assertEquals(rs.getString("String_Node_Str"),null);
  assertEquals(rs.getString("String_Node_Str"),"String_Node_Str");
  assertFalse(rs.next());
  rs.close();
  rs=meta.getPrimaryKeys(null,null,"String_Node_Str");
  assertTrue(rs.next());
  assertEquals(rs.getString("String_Node_Str"),null);
  assertEquals(rs.getString("String_Node_Str"),"String_Node_Str");
  assertFalse(rs.next());
  rs.close();
  rs=meta.getPrimaryKeys(null,null,"String_Node_Str");
  assertTrue(rs.next());
  assertEquals(rs.getString("String_Node_Str"),"String_Node_Str");
  assertEquals(rs.getString("String_Node_Str"),null);
  assertEquals(rs.getInt("String_Node_Str"),1);
  assertTrue(rs.next());
  assertEquals(rs.getString("String_Node_Str"),"String_Node_Str");
  assertEquals(rs.getString("String_Node_Str"),null);
  assertEquals(rs.getInt("String_Node_Str"),0);
  assertFalse(rs.next());
  rs.close();
  rs=meta.getPrimaryKeys(null,null,"String_Node_Str");
  assertTrue(rs.next());
  assertEquals(rs.getString("String_Node_Str"),"String_Node_Str");
  assertEquals(rs.getString("String_Node_Str"),"String_Node_Str");
  assertEquals(rs.getInt("String_Node_Str"),1);
  assertTrue(rs.next());
  assertEquals(rs.getString("String_Node_Str"),"String_Node_Str");
  assertEquals(rs.getString("String_Node_Str"),"String_Node_Str");
  assertEquals(rs.getInt("String_Node_Str"),0);
  assertFalse(rs.next());
  rs.close();
}

Fixed version (ground truth):
@Test public void columnOrderOfgetPrimaryKeys() throws SQLException {
  ResultSet rs;
  ResultSetMetaData rsmeta;
  stat.executeUpdate("String_Node_Str");
  stat.executeUpdate("String_Node_Str");
  stat.executeUpdate("String_Node_Str");
  stat.executeUpdate("String_Node_Str");
  stat.executeUpdate("String_Node_Str" + "String_Node_Str");
  stat.executeUpdate("String_Node_Str");
  rs=meta.getPrimaryKeys(null,null,"String_Node_Str");
  assertFalse(rs.next());
  rsmeta=rs.getMetaData();
  assertEquals(rsmeta.getColumnCount(),6);
  assertEquals(rsmeta.getColumnName(1),"String_Node_Str");
  assertEquals(rsmeta.getColumnName(2),"String_Node_Str");
  assertEquals(rsmeta.getColumnName(3),"String_Node_Str");
  assertEquals(rsmeta.getColumnName(4),"String_Node_Str");
  assertEquals(rsmeta.getColumnName(5),"String_Node_Str");
  assertEquals(rsmeta.getColumnName(6),"String_Node_Str");
  rs.close();
  rs=meta.getPrimaryKeys(null,null,"String_Node_Str");
  assertTrue(rs.next());
  assertEquals(rs.getString("String_Node_Str"),null);
  assertEquals(rs.getString("String_Node_Str"),"String_Node_Str");
  assertEquals(rs.getInt("String_Node_Str"),0);
  assertFalse(rs.next());
  rs.close();
  rs=meta.getPrimaryKeys(null,null,"String_Node_Str");
  assertTrue(rs.next());
  assertEquals(rs.getString("String_Node_Str"),null);
  assertEquals(rs.getString("String_Node_Str"),"String_Node_Str");
  assertEquals(rs.getInt("String_Node_Str"),0);
  assertFalse(rs.next());
  rs.close();
  rs=meta.getPrimaryKeys(null,null,"String_Node_Str");
  assertTrue(rs.next());
  assertEquals(rs.getString("String_Node_Str"),"String_Node_Str");
  assertEquals(rs.getString("String_Node_Str"),null);
  assertEquals(rs.getInt("String_Node_Str"),1);
  assertTrue(rs.next());
  assertEquals(rs.getString("String_Node_Str"),"String_Node_Str");
  assertEquals(rs.getString("String_Node_Str"),null);
  assertEquals(rs.getInt("String_Node_Str"),0);
  assertFalse(rs.next());
  rs.close();
  rs=meta.getPrimaryKeys(null,null,"String_Node_Str");
  assertTrue(rs.next());
  assertEquals(rs.getString("String_Node_Str"),"String_Node_Str");
  assertEquals(rs.getString("String_Node_Str"),"String_Node_Str");
  assertEquals(rs.getInt("String_Node_Str"),1);
  assertTrue(rs.next());
  assertEquals(rs.getString("String_Node_Str"),"String_Node_Str");
  assertEquals(rs.getString("String_Node_Str"),"String_Node_Str");
  assertEquals(rs.getInt("String_Node_Str"),0);
  assertFalse(rs.next());
  rs.close();
  rs=meta.getPrimaryKeys(null,null,"String_Node_Str");
  assertTrue(rs.next());
  assertEquals(rs.getString("String_Node_Str"),"String_Node_Str");
  assertEquals(rs.getString("String_Node_Str"),"String_Node_Str");
  assertEquals(rs.getInt("String_Node_Str"),1);
  assertTrue(rs.next());
  assertEquals(rs.getString("String_Node_Str"),"String_Node_Str");
  assertEquals(rs.getString("String_Node_Str"),"String_Node_Str");
  assertEquals(rs.getInt("String_Node_Str"),0);
  assertFalse(rs.next());
  rs.close();
}