Source:
private CompletableFuture<ClientResponse> runDDLBatch(List<String> sqlStatements, List<SqlNode> sqlNodes) { SortedSet<String> conflictTables = new TreeSet<String>(); Set<String> createdTables = new HashSet<String>(); for (String stmt : sqlStatements) { String rejectionExplanation = SQLLexer.checkPermitted(stmt); if (rejectionExplanation != null) { return makeQuickResponse( ClientResponse.GRACEFUL_FAILURE, rejectionExplanation); } String ddlToken = SQLLexer.extractDDLToken(stmt); if (ddlToken.equals("drop")) { String tableName = SQLLexer.extractDDLTableName(stmt); if (tableName != null) { conflictTables.add(tableName); } } else if (ddlToken.equals("create")) { String tableName = SQLLexer.extractDDLTableName(stmt); if (tableName != null) { createdTables.add(tableName); } } } conflictTables.retainAll(createdTables); if (!conflictTables.isEmpty()) { StringBuilder sb = new StringBuilder(); sb.append("AdHoc DDL contains both DROP and CREATE statements for the following table(s):"); for (String tableName : conflictTables) { sb.append(" "); sb.append(tableName); } sb.append("\nYou cannot DROP and ADD a table with the same name in a single batch " + "(via @AdHoc). Issue the DROP and ADD statements as separate commands."); return makeQuickResponse(ClientResponse.GRACEFUL_FAILURE, sb.toString()); } if (!allowPausedModeWork(false, isAdminConnection())) { return makeQuickResponse( ClientResponse.SERVER_UNAVAILABLE, "Server is paused and is available in read-only mode - please try again later."); } boolean useAdhocDDL = VoltDB.instance().getCatalogContext().cluster.getUseddlschema(); if (!useAdhocDDL) { return makeQuickResponse( ClientResponse.GRACEFUL_FAILURE, "Cluster is configured to use @UpdateApplicationCatalog " + "to change application schema. AdHoc DDL is forbidden."); } logCatalogUpdateInvocation("@AdHoc"); return updateApplication("@AdHoc", null, null, sqlStatements.toArray(new String[0]), sqlNodes, null, false, true); }

Target:
private CompletableFuture<ClientResponse> runDDLBatch(List<String> sqlStatements, List<SqlNode> sqlNodes) { SortedSet<String> conflictTables = new TreeSet<>(); Set<String> createdTables = new HashSet<>(); for (String stmt : sqlStatements) { String rejectionExplanation = SQLLexer.checkPermitted(stmt); if (rejectionExplanation != null) { return makeQuickResponse( ClientResponse.GRACEFUL_FAILURE, rejectionExplanation); } String ddlToken = SQLLexer.extractDDLToken(stmt); if (ddlToken.equals("drop")) { String tableName = SQLLexer.extractDDLTableName(stmt); if (tableName != null) { conflictTables.add(tableName); } } else if (ddlToken.equals("create")) { String tableName = SQLLexer.extractDDLTableName(stmt); if (tableName != null) { createdTables.add(tableName); } } } conflictTables.retainAll(createdTables); if (!conflictTables.isEmpty()) { StringBuilder sb = new StringBuilder(); sb.append("AdHoc DDL contains both DROP and CREATE statements for the following table(s):"); for (String tableName : conflictTables) { sb.append(" "); sb.append(tableName); } sb.append("\nYou cannot DROP and ADD a table with the same name in a single batch " + "(via @AdHoc). Issue the DROP and ADD statements as separate commands."); return makeQuickResponse(ClientResponse.GRACEFUL_FAILURE, sb.toString()); } if (!allowPausedModeWork(false, isAdminConnection())) { return makeQuickResponse( ClientResponse.SERVER_UNAVAILABLE, "Server is paused and is available in read-only mode - please try again later."); } boolean useAdhocDDL = VoltDB.instance().getCatalogContext().cluster.getUseddlschema(); if (!useAdhocDDL) { return makeQuickResponse( ClientResponse.GRACEFUL_FAILURE, "Cluster is configured to use @UpdateApplicationCatalog " + "to change application schema. AdHoc DDL is forbidden."); } logCatalogUpdateInvocation("@AdHoc"); return updateApplication("@AdHoc", null, null, sqlStatements.toArray(new String[0]), sqlNodes, null, false, true); }