cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Podkowinski (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-10755) PreparedStatement is the same id for different Japanese katakana characters with same length
Date Mon, 23 Nov 2015 16:50:10 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-10755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15022437#comment-15022437
] 

Stefan Podkowinski commented on CASSANDRA-10755:
------------------------------------------------

Although the use-case might not be very common, the result of this behavior is pretty bad
as the server will return a different prepared statement from the cache based on the wrong
digest. You could end up executing a different statements compared to what has been passed
to prepare(). I've added a fix that will prevent MD5Digest to rely on the default character
set, which should always be avoided anyway. 

> PreparedStatement is the same id for different Japanese katakana characters with same
length
> --------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-10755
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10755
>             Project: Cassandra
>          Issue Type: Bug
>         Environment: cassandra-2.1.8, java driver 2.1.5, ubuntu 14.04
>            Reporter: ZhaoYang
>
> String q1 = "UPDATE table SET value='タニャア' WHERE key=? AND key2=?";
> String q2 = "UPDATE table SET value='ャアタニ' WHERE key=? AND key2=?";
> when using  session.prepare().
> q1 and q2 will return the prepared-statement with the same prepared ID, but the query
in prepared-statement is correct.
> So if I update using q1 first, all later q2 will not be able to update.( It's means ,
it still updates q1)
> Please note that the Japanese katakana is the same length in q1 and q2.
> I know it's a bad use case for putting value into prepared-query itself. 
> Is it related to how Cassandra cache prepared statement?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message