You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Tyler Hobbs (JIRA)" <ji...@apache.org> on 2015/02/03 23:38:35 UTC

[jira] [Created] (CASSANDRA-8733) List prepend reverses item order

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)