Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove inline comments from DDL files via ScriptRunner #159

Merged
merged 13 commits into from
Apr 26, 2022
4 changes: 2 additions & 2 deletions src/main/java/com/oltpbenchmark/util/ScriptRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ private void runScript(Connection conn, Reader reader) throws IOException, SQLEx
command = new StringBuffer();
}
String trimmedLine = line.trim();
line = line.replaceAll("\\-\\-.*$", ""); // remove comments in line;

if (trimmedLine.startsWith("--") || trimmedLine.startsWith("//")) {
LOG.debug(trimmedLine);
} else if (trimmedLine.length() < 1) {
Expand All @@ -103,8 +105,6 @@ private void runScript(Connection conn, Reader reader) throws IOException, SQLEx

try (Statement statement = conn.createStatement()) {

// println(command);

boolean hasResults = false;
final String sql = command.toString().trim();
if (stopOnError) {
Expand Down