Skip to content

Commit ba7fe1a

Browse files
committed
The same correction
1 parent 1df8f0e commit ba7fe1a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,9 @@ private void executeStatement(String command) throws SQLException {
248248
}
249249
try {
250250
boolean hasResults = statement.execute(sql);
251-
while ((hasResults || (statement.getUpdateCount() != -1))) {
251+
// DO NOT try to 'imporove' the condition even if IDE tells you to!
252+
// It's important that getUpdateCount() is called here.
253+
while (!(!hasResults && statement.getUpdateCount() == -1)) {
252254
checkWarnings(statement);
253255
printResults(statement, hasResults);
254256
hasResults = statement.getMoreResults();

0 commit comments

Comments
 (0)