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

Sylvain Lebresne updated CASSANDRA-5573:
----------------------------------------

    Attachment: 5573.txt

Attaching patch for this.

Now, it turns out that the current behavior of CQL when given unsatisfiable 
conditions is to throw an exception, so it would be somewhat to do it in that 
case too. However, the attached takes the other direction, of always returning 
an empty result set in that case because:
# the current behavior is not consistent anyway. If you do one of:
{noformat}
SELECT v FROM test WHERE k=0 AND v > 1 AND v <= 1
SELECT v FROM test WHERE k=0 AND v > 1 AND v < 2
{noformat}
(where {{v}} is a clustering column), then you get an exception, but if you do
{noformat}
SELECT v FROM test WHERE k=0 AND v >= 2 AND v < 1
{noformat}
then you actually get an empty result set.
# I think returning an empty result set is really more user friendly (and I've 
meant to change that for a while). As far as I know this is also how every SQL 
DB works.

                
> Querying with an empty (impossible) range returns incorrect results
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-5573
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5573
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.2.4
>            Reporter: Mike Schrag
>            Assignee: Sylvain Lebresne
>         Attachments: 5573.txt
>
>
> SELECT * FROM cf WHERE token(key) > 2000 AND token(key) <= 2000 LIMIT 1000 
> ALLOW FILTERING;
> This should return nothing, but instead appears to freak and return arbitrary 
> token values.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to