cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tyler Hobbs (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CASSANDRA-8733) List prepend reverses item order
Date Tue, 03 Feb 2015 22:38:35 GMT
Tyler Hobbs created CASSANDRA-8733:
--------------------------------------

             Summary: List prepend reverses item order
                 Key: CASSANDRA-8733
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8733
             Project: Cassandra
          Issue Type: Bug
          Components: Core
            Reporter: Tyler Hobbs
            Assignee: Tyler Hobbs
             Fix For: 2.1.3, 2.0.13


If you prepend a list of items to a list collection, it will reverse the order of the prepend-list:

{noformat}
cqlsh:ks1> UPDATE foobar SET b = [2, 3] WHERE a = 0;
cqlsh:ks1> select * from foobar;

 a | b
---+--------
 0 | [2, 3]

(1 rows)
cqlsh:ks1> UPDATE foobar SET b = [0, 1] + b WHERE a = 0;
cqlsh:ks1> select * from foobar;

 a | b
---+--------------
 0 | [1, 0, 2, 3]

(1 rows)
{noformat}

This is because we're going through the prepend-list in a normal-order for-loop and prepending
each time (in Lists.Prepender).



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

Mime
View raw message