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

Counters are erroneously allowed as map key type

    XMLWordPrintableJSON

    Details

    • Severity:
      Low

      Description

      We do validate collection value types, but not collection key types, which allows counters to be used as map keys:

      cqlsh> create keyspace test with replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
      cqlsh> use test;
      cqlsh:test> create table test.test (id int primary key, amap map<counter, text>);
      cqlsh:test> insert into test.test (id, amap) values (0, {1: '2'});
      cqlsh:test> select * from test.test;
      
       id | amap
      ----+----------
        0 | {1: '2'}
      
      (1 rows)
      

      This should obviously not be allowed and must be rejected.

      /cc Sylvain Lebresne

        Attachments

          Activity

            People

            • Assignee:
              michaeledge Michael Edge
              Reporter:
              aleksey Aleksey Yeschenko
              Authors:
              Michael Edge
              Reviewers:
              Sylvain Lebresne
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: