From 586d5c2211059c7f49946cecf79de82207226f06 Mon Sep 17 00:00:00 2001 From: wenshao Date: Thu, 13 Jul 2017 11:14:59 +0800 Subject: [PATCH] bug fixed for proxy. --- .../alibaba/druid/proxy/jdbc/PreparedStatementProxyImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/alibaba/druid/proxy/jdbc/PreparedStatementProxyImpl.java b/src/main/java/com/alibaba/druid/proxy/jdbc/PreparedStatementProxyImpl.java index ba14ccc403..8cd619c582 100644 --- a/src/main/java/com/alibaba/druid/proxy/jdbc/PreparedStatementProxyImpl.java +++ b/src/main/java/com/alibaba/druid/proxy/jdbc/PreparedStatementProxyImpl.java @@ -110,6 +110,9 @@ void setParameter(int jdbcIndex, JdbcParameter parameter) { if (parametersSize >= parameters.length) { int oldCapacity = parameters.length; int newCapacity = oldCapacity + (oldCapacity >> 1); + if (newCapacity == 0) { + newCapacity = 4; + } parameters = Arrays.copyOf(parameters, newCapacity); }