Skip to content

Commit

Permalink
0001930: Upgrade from 3.5 to 3.6 of Sybase ASA fails
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Aug 22, 2014
1 parent 691776f commit fde842f
Showing 1 changed file with 27 additions and 1 deletion.
Expand Up @@ -162,8 +162,34 @@ protected Table dropCreateAndThenReadTable(Table table) {
Database database = new Database();
database.addTable(table);
platform.createDatabase(database, true, false);
return platform.getTableFromCache(table.getName(), true);
return platform.getTableFromCache(table.getName(), true);
}

@Test
public void testDisableAutoincrement() throws Exception {
Table table = new Table("TEST_AUTOPK_DISABLE");
table.addColumn(new Column("ID", true));
table.getColumnWithName("ID").setTypeCode(Types.INTEGER);
table.getColumnWithName("ID").setAutoIncrement(true);
table.getColumnWithName("ID").setRequired(true);
table.addColumn(new Column("COL1"));
table.getColumnWithName("COL1").setTypeCode(Types.VARCHAR);
table.getColumnWithName("COL1").setSize("100");
platform.alterCaseToMatchDatabaseDefaultCase(table);

Table tableFromDatabase = dropCreateAndThenReadTable(table);

table.getColumnWithName("ID").setAutoIncrement(false);
table.getColumnWithName("COL1").setSize("1000");
table.getColumnWithName("COL1").setRequired(true);

platform.alterTables(false, table);

tableFromDatabase = platform.getTableFromCache(table.getName(), true);

assertFalse(tableFromDatabase.getColumnWithName("ID").isAutoIncrement());
assertEquals(1000, tableFromDatabase.getColumnWithName("COL1").getSizeAsInt());

}

@Test
Expand Down

0 comments on commit fde842f

Please sign in to comment.