[ https://issues.apache.org/jira/browse/CASSANDRA-9395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
T Jake Luciani updated CASSANDRA-9395: -------------------------------------- Resolution: Fixed Status: Resolved (was: Patch Available) Committed thanks > Prohibit Counter type as part of the PK > --------------------------------------- > > Key: CASSANDRA-9395 > URL: https://issues.apache.org/jira/browse/CASSANDRA-9395 > Project: Cassandra > Issue Type: Bug > Components: CQL > Reporter: Sebastian Estevez > Assignee: Brett Snyder > Labels: lhf > Fix For: 2.2.7, 3.7, 3.0.7 > > Attachments: cassandra-2.1-9395.txt > > > C* let me do this: > {code} > create table aggregated.counter1 ( a counter , b int , PRIMARY KEY (b,a)) > WITH CLUSTERING ORDER BY (a desc); > {code} > and then treated a as an int! > {code} > cqlsh> update aggregated.counter1 set a= a+1 where b = 2 ;Bad Request: > Invalid operation (a = a + 1) for non counter column a > {code} > {code} > insert INTO aggregated.counter1 (b, a ) VALUES ( 3, 2) ; > {code} > (should have given can't insert must update error) > Even though desc table still shows it as a counter type: > {code} > CREATE TABLE counter1 ( > b int, > a counter, > PRIMARY KEY ((b), a) > ) WITH CLUSTERING ORDER BY (a DESC) AND > bloom_filter_fp_chance=0.010000 AND > caching='KEYS_ONLY' AND > comment='' AND > dclocal_read_repair_chance=0.100000 AND > gc_grace_seconds=864000 AND > index_interval=128 AND > read_repair_chance=0.000000 AND > replicate_on_write='true' AND > populate_io_cache_on_flush='false' AND > default_time_to_live=0 AND > speculative_retry='99.0PERCENTILE' AND > memtable_flush_period_in_ms=0 AND > compaction={'class': 'SizeTieredCompactionStrategy'} AND > compression={'sstable_compression': 'LZ4Compressor'}; > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)