Merge pull request #2251 from joe776/master

[#2252] ArrayIndexOutOfBoundsException, when rendering plain SQL that is terminated by a comment
This commit is contained in:
Lukas Eder 2013-02-20 05:55:04 -08:00
commit 4b61106f4a

View File

@ -733,10 +733,10 @@ final class Utils {
if (peek(sqlChars, i, "--")) {
// Consume the complete comment
for (; sqlChars[i] != '\r' && sqlChars[i] != '\n'; render.sql(sqlChars[i++]));
for (; i < sqlChars.length && sqlChars[i] != '\r' && sqlChars[i] != '\n'; render.sql(sqlChars[i++]));
// Consume the newline character
render.sql(sqlChars[i]);
if (i < sqlChars.length) render.sql(sqlChars[i]);
}
// [#1797] Skip content inside of multi-line comments, e.g.
@ -1739,7 +1739,7 @@ final class Utils {
return (T) wasNull(rs, Boolean.valueOf(rs.getBoolean(index)));
}
else if (type == BigInteger.class) {
// The SQLite JDBC driver doesn't support BigDecimals
// The SQLite JDBC driver doesn't support BigDecimals
if (ctx.getDialect() == SQLDialect.SQLITE) {
return Convert.convert(rs.getString(index), (Class<T>) BigInteger.class);
}