[
https://issues.apache.org/jira/browse/CASSANDRA-11487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15224268#comment-15224268
]
Sylvain Lebresne commented on CASSANDRA-11487:
----------------------------------------------
In theory I totally agree that it's an inconsistency and it would be good to
fix it long term.
In practice, we internally special case empty keys to correspond to the
{{MINIMUM}} token, which shouldn't correspond to any actual user key (at least,
I definitively remember some code making that assumption, even though I can't
remember which one exactly), so fixing this is not trivial. I'm not saying it
can't be fixed because I'm don't remember the implications of all this, but we
should treat with this very carefully as this could easily do more harm than
good. Especially since, let's be honest, having empty keys is a little bit of a
weird case and if it wasn't for the inconsistency with composite keys, not
supporting this wouldn't really matter.
> Make behavior of empty strings in primary keys consistent.
> ----------------------------------------------------------
>
> Key: CASSANDRA-11487
> URL: https://issues.apache.org/jira/browse/CASSANDRA-11487
> Project: Cassandra
> Issue Type: Improvement
> Reporter: Jeremiah Jordan
> Priority: Minor
>
> Empty strings are allowed in composite primary keys, but not single-column
> primary keys.
> Example:
> {code}
> create table bla (
> pk text primary key,
> val text
> );
> insert into bla (pk, val) values ('', '');
> {code}
> throws: Key may not be empty.
> {code}
> create table bla2 (
> pk text,
> pk2 text,
> val text,
> primary key ((pk, pk2))
> );
> insert into bla2 (pk, pk2, val) values ('', '', '');
> {code}
> succeeds
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)