@Test
public void testTypesCanBeJoined() throws Exception {

    // Every time can be joined to itself
    for(TClass t : typesRegistry.getTypeClasses()) {
        assertTrue(t.toString(), TypeValidator.isSupportedForJoin(t, t));
    }
    // All int types can be joined together except bigint unsigned
    final String intTypeNames[] = {"tinyint", "smallint", "int", "mediumint", "bigint"};
    for(String t1 : intTypeNames) {
        String t1U = t1 + " unsigned";
        for(String t2 : intTypeNames) {
            String t2U = t2 + " unsigned";
            boolean t1UIsBigint = "bigint unsigned".equals(t1U);
            boolean t2UIsBigint = "bigint unsigned".equals(t2U);
            assertTrue(t1+"->"+t2, canTypesBeJoined("MCOMPAT", t1, "MCOMPAT", t2));
            assertEquals(t1U + "->" + t2, !t1UIsBigint, canTypesBeJoined("MCOMPAT", t1U, "MCOMPAT", t2));
            assertEquals(t1 + "->" + t2U, !t2UIsBigint, canTypesBeJoined("MCOMPAT", t1, "MCOMPAT", t2U));
            assertEquals(t1U+"->"+t2U, (t1UIsBigint == t2UIsBigint), canTypesBeJoined("MCOMPAT", t1U, "MCOMPAT", t2U));
        }
    }
    // Check a few that cannot be
    assertFalse(canTypesBeJoined("MCOMPAT", "int", "MCOMPAT", "varchar"));
    assertFalse(canTypesBeJoined("MCOMPAT", "int", "MCOMPAT", "timestamp"));
    assertFalse(canTypesBeJoined("MCOMPAT", "int", "MCOMPAT", "decimal"));
    assertFalse(canTypesBeJoined("MCOMPAT", "int", "MCOMPAT", "double"));
    assertFalse(canTypesBeJoined("MCOMPAT", "char", "MCOMPAT", "binary"));
}