You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Sylvain Lebresne (JIRA)" <ji...@apache.org> on 2014/02/27 14:02:19 UTC

[jira] [Updated] (CASSANDRA-6779) BooleanType is not too boolean

     [ https://issues.apache.org/jira/browse/CASSANDRA-6779?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylvain Lebresne updated CASSANDRA-6779:
----------------------------------------

    Attachment: 6779.txt

I'll note that we could either fix compare or fix validation to only accept 0 or 1, not any byte, but I suggest fixing compare because fixing validation could have a slightly bigger chance of breaking someone.

> BooleanType is not too boolean
> ------------------------------
>
>                 Key: CASSANDRA-6779
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6779
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>            Priority: Minor
>             Fix For: 2.0.6
>
>         Attachments: 6779.txt
>
>
> The BooleanType validator accepts any byte (it only checks it's one byte long) and the comparator actually uses the ByteBuffer.compareTo() method on it's input. So that BooleanType is really ByteType and accepts 256 values.
> Note that in practice, it's likely no-one or almost no-one has ever used BooleanType as a comparator, and almost surely the handful that might have done it have stick to sending only 0 for false and 1 for true. Still, it's probably worth fixing before it actually hurt someone. 



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)