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

List prepend reverses item order

Agile BoardAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 2.0.13, 2.1.3
    • None
    • None
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            thobbs Tom Hobbs Assign to me
            thobbs Tom Hobbs
            Tom Hobbs
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment