[ 
https://issues.apache.org/jira/browse/CASSANDRA-10760?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sylvain Lebresne updated CASSANDRA-10760:
-----------------------------------------
    Reviewer: Sylvain Lebresne

> Counters are erroneously allowed as map key type
> ------------------------------------------------
>
>                 Key: CASSANDRA-10760
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10760
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL
>            Reporter: Aleksey Yeschenko
>            Assignee: Michael Edge
>            Priority: Minor
>              Labels: cql, cqlsh
>             Fix For: 2.1.x, 2.2.x, 3.0.x
>
>         Attachments: CASSANDRA-3.0-10760-Counters-in-Maps.patch
>
>
> We do validate collection value types, but not collection key types, which 
> allows counters to be used as map keys:
> {noformat}
> 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)
> {noformat}
> This should obviously not be allowed and must be rejected.
> /cc [~slebresne]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to