Skip to content

Commit 1bac47f

Browse files
committed
fix for http://code.google.com/p/mybatis/issues/detail?id=561 , delimiter may not be the last character (there may be trailing comments)
1 parent 0b4c94c commit 1bac47f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/apache/ibatis/jdbc/ScriptRunner.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ private boolean lineIsComment(String trimmedLine) {
203203
}
204204

205205
private boolean commandReadyToExecute(String trimmedLine) {
206-
return !fullLineDelimiter && trimmedLine.endsWith(delimiter) || fullLineDelimiter && trimmedLine.equals(delimiter);
206+
// issue #561 remove anything after the delimiter
207+
return !fullLineDelimiter && trimmedLine.contains(delimiter) || fullLineDelimiter && trimmedLine.equals(delimiter);
207208
}
208209

209210
private void executeStatement(String command) throws SQLException, UnsupportedEncodingException {

0 commit comments

Comments
 (0)