You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Adam Holmberg (Jira)" <ji...@apache.org> on 2020/08/11 21:10:00 UTC
[jira] [Updated] (CASSANDRA-15976) Incorrect parsing of the
timestamp with less than 3 digits in the milliseconds
[ https://issues.apache.org/jira/browse/CASSANDRA-15976?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Adam Holmberg updated CASSANDRA-15976:
--------------------------------------
Bug Category: Parent values: Correctness(12982)Level 1 values: API / Semantic Implementation(12988)
Complexity: Normal
Component/s: CQL/Interpreter
Discovered By: User Report
Fix Version/s: 4.0-beta2
Severity: Normal
Status: Open (was: Triage Needed)
> Incorrect parsing of the timestamp with less than 3 digits in the milliseconds
> ------------------------------------------------------------------------------
>
> Key: CASSANDRA-15976
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15976
> Project: Cassandra
> Issue Type: Bug
> Components: CQL/Interpreter
> Reporter: Alex Ott
> Assignee: Adam Holmberg
> Priority: Normal
> Fix For: 4.0-beta2
>
>
> (tested on 4.0-beta1, but should be in all versions)
> Right now, Cassandra incorrectly handles timestamps with less than 3 digits in the milliseconds part. Timestamps (valid from the Java point of view (see below output in Scala) are either rejected (if we have 1 digit only), or incorrectly parsed when 2 digits are specified:
> {noformat}
> cqlsh> create table test.tm (id int primary key, tm timestamp);
> cqlsh> insert into test.tm(id, tm) values (2, '2020-07-24T10:00:01.2Z');
> InvalidRequest: Error from server: code=2200 [Invalid query] message="Unable to coerce '2020-07-24T10:00:01.2Z' to a formatted date (long)"
> cqlsh> insert into test.tm(id, tm) values (1, '2020-07-24T10:00:01.12Z');
> cqlsh> select * from test.tm;
> id | tm
> ----+---------------------------------
> 1 | 2020-07-24 10:00:01.012000+0000
> (1 rows)
> {noformat}
> Checking with Instant:
> {noformat}
> scala> java.time.Instant.parse("2020-07-24T10:00:01.12Z")
> res0: java.time.Instant = 2020-07-24T10:00:01.120Z
> scala> java.time.Instant.parse("2020-07-24T10:00:01.2Z")
> res1: java.time.Instant = 2020-07-24T10:00:01.200Z
> {noformat}
> Imho it should be fixed (Cc: [~aholmber])
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org