提交 8613b4bc authored 作者: Thomas Mueller's avatar Thomas Mueller

The internal IntArray class did not work correctly when initialized with a zero length array.

上级 40f0e66b
......@@ -71,7 +71,7 @@ public class IntArray {
private void checkCapacity() {
if (size >= data.length) {
int[] d = new int[data.length * 2];
int[] d = new int[Math.max(4, data.length * 2)];
System.arraycopy(data, 0, d, 0, data.length);
data = d;
}
......
......@@ -126,6 +126,19 @@ public class JdbcUtils {
return getConnection(driver, url, prop);
}
/**
* Escape table or schema patterns used for DatabaseMetaData functions.
*
* @param pattern the pattern
* @return the escaped pattern
*/
public static String escapeMetaDataPattern(String pattern) {
if (pattern == null || pattern.length() == 0) {
return pattern;
}
return StringUtils.replaceAll(pattern, "\\", "\\\\");
}
/**
* Open a new database connection with the given settings.
*
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论