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

Stefan Miklosovic commented on CASSANDRA-19566:
-----------------------------------------------

[CASSANDRA-19566-4.0|https://github.com/instaclustr/cassandra/tree/CASSANDRA-19566-4.0]
{noformat}
java8_pre-commit_tests                          
  ✓ j8_build                                          5m 9s
  ✓ j8_cqlsh-dtests-py2-no-vnodes                    6m 30s
  ✓ j8_cqlsh-dtests-py2-with-vnodes                  8m 15s
  ✓ j8_cqlsh_dtests_py3                              7m 52s
  ✓ j8_cqlsh_dtests_py311                            7m 39s
  ✓ j8_cqlsh_dtests_py311_vnode                      9m 13s
  ✓ j8_cqlsh_dtests_py38                             7m 35s
  ✓ j8_cqlsh_dtests_py38_vnode                       10m 6s
  ✓ j8_cqlsh_dtests_py3_vnode                        8m 31s
  ✓ j8_cqlshlib_tests                                8m 55s
  ✓ j8_dtests                                       32m 10s
  ✓ j8_dtests_vnode                                 36m 28s
  ✓ j8_jvm_dtests                                    16m 6s
  ✓ j11_dtests_vnode                                36m 12s
  ✓ j11_dtests                                       34m 0s
  ✓ j11_cqlsh_dtests_py3_vnode                       5m 46s
  ✓ j11_cqlsh_dtests_py38_vnode                      5m 39s
  ✓ j11_cqlsh_dtests_py38                            5m 58s
  ✓ j11_cqlsh_dtests_py311_vnode                     5m 52s
  ✓ j11_cqlsh_dtests_py311                           5m 24s
  ✓ j11_cqlsh_dtests_py3                             5m 24s
  ✓ j11_cqlsh-dtests-py2-with-vnodes                 5m 38s
  ✓ j11_cqlsh-dtests-py2-no-vnodes                   5m 40s
  ✕ j8_unit_tests                                   10m 17s
      org.apache.cassandra.cql3.MemtableSizeTest testTruncationReleasesLogSpace
  ✕ j8_utests_system_keyspace_directory               8m 9s
      org.apache.cassandra.cql3.MemtableSizeTest testTruncationReleasesLogSpace
  ✕ j11_unit_tests                                   7m 58s
      org.apache.cassandra.cql3.MemtableSizeTest testTruncationReleasesLogSpace
      org.apache.cassandra.cql3.ViewFilteringClustering2Test 
testClusteringKeyFilteringRestrictions[0]
{noformat}

[java8_pre-commit_tests|https://app.circleci.com/pipelines/github/instaclustr/cassandra/4207/workflows/1b8ba460-20c2-42ad-8d89-704a09c4d211]


> JSON encoded timestamp value does not always match non-JSON encoded value
> -------------------------------------------------------------------------
>
>                 Key: CASSANDRA-19566
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-19566
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Legacy/Core, Legacy/CQL
>            Reporter: Bowen Song
>            Assignee: Stefan Miklosovic
>            Priority: Normal
>             Fix For: 4.0.x, 4.1.x, 5.0.x, 5.x
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Description:
> "SELECT JSON ..." and "toJson(...)" on Cassandra 4.1.4 produces different 
> date than "SELECT ..."  for some timestamp type values.
>  
> Steps to reproduce:
> {code:java}
> $ sudo docker pull cassandra:4.1.4
> $ sudo docker create --name cass cassandra:4.1.4
> $ sudo docker start cass
> $ # wait for the Cassandra instance becomes ready
> $ sudo docker exec -ti cass cqlsh
> Connected to Test Cluster at 127.0.0.1:9042
> [cqlsh 6.1.0 | Cassandra 4.1.4 | CQL spec 3.4.6 | Native protocol v5]
> Use HELP for help.
> cqlsh> create keyspace test WITH replication = {'class': 'SimpleStrategy', 
> 'replication_factor': 1};
> cqlsh> use test;
> cqlsh:test> create table tbl (id int, ts timestamp, primary key (id));
> cqlsh:test> insert into tbl (id, ts) values (1, -13767019200000);
> cqlsh:test> select tounixtimestamp(ts), ts, tojson(ts) from tbl where id=1;
>  system.tounixtimestamp(ts) | ts                              | 
> system.tojson(ts)
> ----------------------------+---------------------------------+----------------------------
>             -13767019200000 | 1533-09-28 12:00:00.000000+0000 | "1533-09-18 
> 12:00:00.000Z"
> (1 rows)
> cqlsh:test> select json * from tbl where id=1;
>  [json]
> ---------------------------------------------
>  {"id": 1, "ts": "1533-09-18 12:00:00.000Z"}
> (1 rows)
> {code}
>  
> Expected behaviour:
> The "select ts", "select tojson(ts)" and "select json *" should all produce 
> the same date.
>  
> Actual behaviour:
> The "select ts" produced the "1533-09-28" date but the "select tojson(ts)" 
> and "select json *" produced the "1533-09-18" date.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to