Repository: cassandra
Updated Branches:
  refs/heads/trunk 4901af68a -> f8153a1d6


Force encoding charset when computed prepared statement IDs

patch by Stefan Podkowinski; reviewed by slebresne for CASSANDRA-10755


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b5b9f710
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b5b9f710
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b5b9f710

Branch: refs/heads/trunk
Commit: b5b9f7106d66eda6e41cea292bc569886b701448
Parents: cdf0485
Author: Stefan Podkowinski <stefan.podkowin...@1und1.de>
Authored: Mon Nov 23 17:12:35 2015 +0100
Committer: Sylvain Lebresne <sylv...@datastax.com>
Committed: Thu Nov 26 11:02:30 2015 +0100

----------------------------------------------------------------------
 CHANGES.txt                                        |  1 +
 src/java/org/apache/cassandra/utils/MD5Digest.java | 10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b5b9f710/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 7978a56..ee0bc61 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.12
+ * Force encoding when computing statement ids (CASSANDRA-10755)
  * Properly reject counters as map keys (CASSANDRA-10760)
  * Fix the sstable-needs-cleanup check (CASSANDRA-10740)
  * (cqlsh) Print column names before COPY operation (CASSANDRA-8935)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b5b9f710/src/java/org/apache/cassandra/utils/MD5Digest.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/MD5Digest.java 
b/src/java/org/apache/cassandra/utils/MD5Digest.java
index 3f46458..2dc57de 100644
--- a/src/java/org/apache/cassandra/utils/MD5Digest.java
+++ b/src/java/org/apache/cassandra/utils/MD5Digest.java
@@ -17,6 +17,7 @@
  */
 package org.apache.cassandra.utils;
 
+import java.io.UnsupportedEncodingException;
 import java.util.Arrays;
 
 /**
@@ -50,7 +51,14 @@ public class MD5Digest
 
     public static MD5Digest compute(String toHash)
     {
-        return compute(toHash.getBytes());
+        try
+        {
+            return compute(toHash.getBytes("UTF-8"));
+        }
+        catch (UnsupportedEncodingException e)
+        {
+            throw new RuntimeException(e.getMessage());
+        }
     }
 
     @Override

Reply via email to