This is an automated email from the ASF dual-hosted git repository.
kfujino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/master by this push:
new 9ea280c Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63320
Ensure that StatementCache caches statements that include arrays in arguments.
9ea280c is described below
commit 9ea280c7266765a20b405059f9b02be5d5942133
Author: KeiichiFujino <[email protected]>
AuthorDate: Tue Apr 9 16:04:33 2019 +0900
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63320
Ensure that StatementCache caches statements that include arrays in
arguments.
---
.../java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java | 4 ++--
webapps/docs/changelog.xml | 4 ++++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
index 4d20f86..55baf23 100644
---
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
+++
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
@@ -346,7 +346,7 @@ public class StatementCache extends
StatementDecoratorInterceptor implements Sta
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result + Arrays.hashCode(args);
+ result = prime * result + Arrays.deepHashCode(args);
result = prime * result
+ ((stmtType == null) ? 0 : stmtType.hashCode());
return result;
@@ -361,7 +361,7 @@ public class StatementCache extends
StatementDecoratorInterceptor implements Sta
if (getClass() != obj.getClass())
return false;
CacheKey other = (CacheKey) obj;
- if (!Arrays.equals(args, other.args))
+ if (!Arrays.deepEquals(args, other.args))
return false;
if (stmtType == null) {
if (other.stmtType != null)
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index e4ccff3..da228e1 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -181,6 +181,10 @@
Connection that expired reconnects rather than closes it. Patch
provided
by toby1984. (kfujino)
</fix>
+ <fix>
+ <bug>63320</bug>: Ensure that <code>StatementCache</code> caches
+ statements that include arrays in arguments. (kfujino)
+ </fix>
</changelog>
</subsection>
<subsection name="Other">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]