[ https://issues.apache.org/jira/browse/CASSANDRA-13116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin Lerer resolved CASSANDRA-13116. ---------------------------------------- Resolution: Duplicate {{ALTER TYPE}} can cause a lot of problems. The plan is to remove it in CASSANDRA-12443. > Don't allow changing the primary key from int to varint > ------------------------------------------------------- > > Key: CASSANDRA-13116 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13116 > Project: Cassandra > Issue Type: Bug > Components: Core > Reporter: Tom van der Woerdt > Priority: Critical > > Simply put : > {code} > cqlsh> create table foo (id int primary key, value text); > [some inserts] > cqlsh> select * from foo where id in (1, 128, 256, 65535, 65536, 16777215, > 16777216, 2147483647); > id | value > ------------+------- > 1 | test > 128 | test > 256 | test > 65535 | test > 65536 | test > 16777215 | test > 16777216 | test > 2147483647 | test > (8 rows) > cqlsh> alter table foo alter id TYPE varint; > cqlsh> select * from foo where id in (1, 128, 256, 65535, 65536, 16777215, > 16777216, 2147483647); > id | value > ------------+------- > 16777215 | test > 16777216 | test > 2147483647 | test > (3 rows) > cqlsh> select * from foo; > id | value > ------------+------- > 128 | test > 16777216 | test > 1 | test > 2147483647 | test > 16777215 | test > 256 | test > 65535 | test > 65536 | test > {code} > This could really ruin someone's day... -- This message was sent by Atlassian JIRA (v6.3.4#6332)