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

Jonathan Ellis updated CASSANDRA-3424:
--------------------------------------

    Attachment: 3424-v2.txt

I think we can do a simpler fix actually (v2).  We actually *always* want a row 
in the resultset for each row that exists in the database; the original "skip 
null CF" code is flat out wrong.  Consider these cases:

{noformat}
SELECT * FROM foo WHERE key = 'bar';
SELECT x..y FROM foo WHERE key = 'bar';
SELECT key, x, y FROM foo WHERE key = 'bar';
SELECT x, y FROM foo WHERE key = 'bar';
{noformat}

In none of these cases should we leave the row out of the resultset if there 
were no columns found (but the row exists).  (Possible exception for the * case 
aka "range ghosts" but for now that is the behavior we deliver.)

So, v2 removes the "leave nulls out entirely" check and adds NPE protection to 
the columnRange case.
                
> Selecting just the row_key returns nil instead of just the row_key
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-3424
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3424
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Kelley Reynolds
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>              Labels: cql
>             Fix For: 1.0.3
>
>         Attachments: 3424-v2.txt, CASSANDRA-3424.patch
>
>
> CREATE KEYSPACE CassandraCQLTestKeyspace WITH 
> strategy_class='org.apache.cassandra.locator.SimpleStrategy' AND 
> strategy_options:replication_factor=1
> USE CassandraCQLTestKeyspace
> CREATE COLUMNFAMILY row_key_validation_cf_ascii (id ascii PRIMARY KEY, 
> test_column text)
> INSERT INTO row_key_validation_cf_ascii (id, test_column) VALUES ('test 
> string', 'test')
> # Works as expected
> SELECT * FROM row_key_validation_cf_ascii WHERE id = 'test string'
> # Returns an empty result, unexpected
> SELECT id FROM row_key_validation_cf_ascii WHERE id = 'test string'

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to