Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-8733

List prepend reverses item order

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Fix Version/s: 2.0.13, 2.1.3
    • Component/s: None
    • Labels:
      None
    • Severity:
      Normal

      Description

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

      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)
      

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

        Attachments

          Activity

            People

            • Assignee:
              thobbs Tom Hobbs Assign to me
              Reporter:
              thobbs Tom Hobbs
              Authors:
              Tom Hobbs

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment