Skip to content

Commit

Permalink
fix: 修复打印预编译参数sql时可能下标越界错误
Browse files Browse the repository at this point in the history
  • Loading branch information
zhou-hao committed Aug 31, 2023
1 parent 9a2f42d commit 6058109
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ public static String toNativeSql(String sql, Object... parameters) {
for (int i = 0, sqlLen = sql.length(); i < sqlLen; i++) {
char c = sql.charAt(i);
if (c == '?') {
if (stringParameter.length >= parameterIndex) {
if (stringParameter.length > parameterIndex) {
builder.append(stringParameter[parameterIndex++]);
} else {
builder.append("null");
builder.append("unbound");
}
} else {
builder.append(c);
Expand Down

0 comments on commit 6058109

Please sign in to comment.