[
https://issues.apache.org/jira/browse/CASSANDRA-1910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12975880#action_12975880
]
Hudson commented on CASSANDRA-1910:
-----------------------------------
Integrated in Cassandra-0.6 #41 (See
[https://hudson.apache.org/hudson/job/Cassandra-0.6/41/])
examine the right nibble when validating TimeUUIDs. patch by gdusbabek,
reviewed by jbellis. CASSANDRA-1910
> validation of time uuid is incorrect
> ------------------------------------
>
> Key: CASSANDRA-1910
> URL: https://issues.apache.org/jira/browse/CASSANDRA-1910
> Project: Cassandra
> Issue Type: Bug
> Components: Core
> Reporter: Dave
> Assignee: Gary Dusbabek
> Priority: Minor
> Fix For: 0.6.9, 0.7.0
>
> Attachments: 1910-0.6.txt,
> v1-0001-examine-the-right-nibble-when-validating-TimeUUIDs.txt
>
>
> It appears _TimeUUIDType_ (as of 12/9) is checking the wrong bits when
> validating a time UUID as version 1.
> Per the comment and rfc4122, "_version is bits 4-7 of byte 6_", however
> validate() is actually checking the least significant bits:
> > _if ((slice.get() & 0x0f) != 1)_
> Sample java/hector code:
> {code}
> // displays "version 1" but validation fails
> java.util.UUID uuid1 =
> java.util.UUID.fromString("00000000-0000-1000-0000-000000000000");
> System.out.println(uuid1 + " " + uuid1.version());
> TimeUUIDType.instance.validate(UUIDSerializer.get().toByteBuffer(uuid1));
> // displays "version 2" but validation succeeds
> java.util.UUID uuid2 =
> java.util.UUID.fromString("00000000-0000-2100-0000-000000000000");
> System.out.println(uuid2 + " " + uuid2.version());
> TimeUUIDType.instance.validate(UUIDSerializer.get().toByteBuffer(uuid2));
> {code}
> The issue can be seen with any UUID where the timestamp doesn't start with 1:
> b54adc00-67f9-10d9-9669-0800200c9a66, (timestamp year 1776) version 1 fails
> b54adc00-67f9-12d9-9669-0800200c9a66, (timestamp year 2233) version 1 fails
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.