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

List prepend reverses item order

    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

        1. 8733-2.0.txt
          0.9 kB
          Tom Hobbs

          Activity

            People

            • Assignee:
              thobbs Tom Hobbs
              Reporter:
              thobbs Tom Hobbs
              Authors:
              Tom Hobbs
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: