Skip to content

Commit

Permalink
Remove inline comments from DDL files via ScriptRunner (cmu-db#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanda authored Apr 26, 2022
1 parent 72f7d02 commit 29936f3
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 29936f3

Please sign in to comment.