public void testDropTableWithIndexesAndProcedures() throws Exception {
String pathToCatalog = Configuration.getPathToCatalogForTest("adhocddl.jar");
String pathToDeployment = Configuration.getPathToCatalogForTest("adhocddl.xml");
VoltProjectBuilder builder = new VoltProjectBuilder();
builder.addLiteralSchema(
"create table BLAH (" +
"ID int default 0 not null, " +
"VAL varchar(32) default null," +
"PRIMARY KEY(ID));\n" +
"create table VIEWBASE (" +
"ID int default 0 not null, " +
"VAL varchar(32) default null," +
"PRIMARY KEY(ID));\n" +
"create table DROPME (" +
"ID int default 0 not null, " +
"VAL varchar(32) default null," +
"PRIMARY KEY(ID));\n" +
"create assumeunique index pkey_idx on DROPME(VAL);\n" +
"create view BLAT (VAL, TOTAL) as select VAL, COUNT(*) from VIEWBASE group by VAL;\n"
);
builder.addPartitionInfo("BLAH", "ID");
builder.addPartitionInfo("DROPME", "ID");
builder.addStmtProcedure("BLERG", "select * from BLAH where ID = ?");
builder.setUseDDLSchema(true);
boolean success = builder.compile(pathToCatalog, 2, 1, 0);
assertTrue("Schema compilation failed", success);
MiscUtils.copyFile(builder.getPathToDeployment(), pathToDeployment);
VoltDB.Configuration config = new VoltDB.Configuration();
config.m_pathToCatalog = pathToCatalog;
config.m_pathToDeployment = pathToDeployment;