Source:
public void testBasicCreateTable() throws Exception { String pathToCatalog = Configuration.getPathToCatalogForTest("adhocddl.jar"); String pathToDeployment = Configuration.getPathToCatalogForTest("adhocddl.xml"); VoltProjectBuilder builder = new VoltProjectBuilder(); builder.addLiteralSchema("--dont care"); 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; try { startSystem(config); assertFalse(findTableInSystemCatalogResults("FOO")); try { m_client.callProcedure("@AdHoc", "create table FOO (ID int default 0, VAL varchar(64 bytes));"); } catch (ProcCallException pce) { fail("create table should have succeeded"); } assertTrue(findTableInSystemCatalogResults("FOO")); boolean threw = false; try { m_client.callProcedure("@AdHoc", "create table FOO (ID int default 0, VAL varchar(64 bytes));"); } catch (ProcCallException pce) { threw = true; } assertTrue("Shouldn't have been able to create table FOO twice.", threw); String[] testType = {"tinyint", "smallint", "integer", "bigint"}; String[] minVal = {"-128", "-32768", "-2147483648", "-9223372036854775808"}; for (int i = 0; i < 4; i++) { threw = false; try { m_client.callProcedure("@AdHoc", "create table t (c " + testType[i] + " default " + minVal[i] + " );"); } catch (ProcCallException pce) { threw = true; } assertTrue("Create table with default minimum value will throw exception.", threw); } } finally { teardownSystem(); } }

Target:
public void testBasicCreateTable() throws Exception { String pathToCatalog = Configuration.getPathToCatalogForTest("adhocddl.jar"); String pathToDeployment = Configuration.getPathToCatalogForTest("adhocddl.xml"); VoltProjectBuilder builder = new VoltProjectBuilder(); builder.addLiteralSchema("--dont care"); 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; try { startSystem(config); assertFalse(findTableInSystemCatalogResults("FOO")); try { m_client.callProcedure("@AdHoc", "create table FOO (ID int default 0, VAL varchar(64 bytes));"); } catch (ProcCallException pce) { fail("create table should have succeeded"); } assertTrue(findTableInSystemCatalogResults("FOO")); boolean threw = false; try { m_client.callProcedure("@AdHoc", "create table FOO (ID int default 0, VAL varchar(64 bytes));"); } catch (ProcCallException pce) { threw = true; } assertTrue("Shouldn't have been able to create table FOO twice.", threw); String[] testType = {"tinyint", "smallint", "integer", "bigint"}; String[] minVal = {"-128", "-32768", "-2147483648", "-9223372036854775808"}; for (int i = 0; i < testType.length; i++) { threw = false; try { m_client.callProcedure("@AdHoc", "create table t (c " + testType[i] + " default " + minVal[i] + ");"); } catch (ProcCallException pce) { assertTrue(pce.getMessage().contains("data exception: numeric value out of range")); threw = true; } assertTrue("Creating numeric table column using the reserved minimum value as " + "default should throw an exception.", threw); } } finally { teardownSystem(); } }