Skip to content

Commit

Permalink
ARQ-1444: Oracle does not support query delimiter inside statements
Browse files Browse the repository at this point in the history
  • Loading branch information
mgraciano committed Jul 26, 2013
1 parent 34a32ac commit 9c2d696
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Expand Up @@ -115,7 +115,12 @@ public void execute(String script)

for (String statement : statements)
{
executeStatement(specialCharactersReplacer.unescape(statement));
String sql = statement;
if (sql.endsWith(statementDelimiter)) {
sql = sql.substring(0, sql.length() - statementDelimiter.length());
}

executeStatement(specialCharactersReplacer.unescape(sql));
}
}

Expand Down
Expand Up @@ -247,7 +247,7 @@ public void should_insert_special_entities() throws Exception
verify(connection.createStatement(), times(1)).execute(statementsCaptor.capture());
assertThat(statementsCaptor.getAllValues()).containsSequence(
"insert into useraccount (id, firstname, lastname, username, password)" +
" values (1, 'John', 'Smith & Company', 'doovde;;', '&test©');"
" values (1, 'John', 'Smith & Company', 'doovde;;', '&test©')"
);
}

Expand All @@ -266,7 +266,7 @@ public void should_insert_special_entities_with_custom_end_line() throws Excepti
verify(connection.createStatement(), times(1)).execute(statementsCaptor.capture());
assertThat(statementsCaptor.getAllValues()).containsSequence(
"insert into useraccount (id, firstname, lastname, username, password)" +
" values (1, 'John', 'Smith & Company', 'doovde;;', '&test©')\nGO"
" values (1, 'John', 'Smith & Company', 'doovde;;', '&test©')\n"
);
}

Expand All @@ -284,9 +284,9 @@ public void should_insert_xml_tags() throws Exception
verify(connection.createStatement(), times(2)).execute(statementsCaptor.capture());
assertThat(statementsCaptor.getAllValues()).containsSequence(
"insert into useraccount (id, firstname, lastname, username, password)" +
" values (1, 'John', 'Smith', 'doovde', '<strong>vodka</strong>');",
" values (1, 'John', 'Smith', 'doovde', '<strong>vodka</strong>')",
"insert into useraccount (id, firstname, lastname, username, password)" +
" values (2, 'John', 'Sharp', 'asdqwe', 'closing only</strong>');"
" values (2, 'John', 'Sharp', 'asdqwe', 'closing only</strong>')"
);
}

Expand Down

0 comments on commit 9c2d696

Please sign in to comment.