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

Benjamin Lerer updated CASSANDRA-6075:
--------------------------------------
    Attachment: CASSANDRA-2.1-6075-PART2.txt
                CASSANDRA-2.0-6075-PART2.txt

Completely forgot the case of the slice with start and end bound(e.g. 
token(key) >= token(1) and token(key) < token(2))
That is what broke the Pig-Tests. Sorry.
Here are the patchs to fix that problem on the 2.0 and 2.1+ branches.

I also dicover while trying to add more tests than the current approach to 
handle token functions is broken. With the current approach we cannot reject 
queries like:
{{SELECT * FROM %s WHERE token(a, b) > token(?, ?) and token(b) < token(?, ?)}} 
or {{SELECT * FROM %s WHERE token(a) > token(?, ?) and token(b) > token(?, ?)}} 
I will try to find another solution as part of #CASSANDRA-7981

> The token function should allow column identifiers in the correct order only
> ----------------------------------------------------------------------------
>
>                 Key: CASSANDRA-6075
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6075
>             Project: Cassandra
>          Issue Type: Bug
>         Environment: Cassandra 1.2.9
>            Reporter: Michaël Figuière
>            Assignee: Benjamin Lerer
>            Priority: Minor
>              Labels: cql
>             Fix For: 2.0.11, 2.1.1
>
>         Attachments: CASSANDRA-2.0-6075-PART2.txt, 
> CASSANDRA-2.1-6075-PART2.txt, CASSANDRA-2.1-6075.txt, CASSANDRA-6075.txt
>
>
> Given the following table:
> {code}
> CREATE TABLE t1 (a int, b text, PRIMARY KEY ((a, b)));
> {code}
> The following request returns an error in cqlsh as literal arguments order is 
> incorrect:
> {code}
> SELECT * FROM t1 WHERE token(a, b) > token('s', 1);
> Bad Request: Type error: 's' cannot be passed as argument 0 of function token 
> of type int
> {code}
> But surprisingly if we provide the column identifier arguments in the wrong 
> order no error is returned:
> {code}
> SELECT * FROM t1 WHERE token(a, b) > token(1, 'a'); // correct order is valid
> SELECT * FROM t1 WHERE token(b, a) > token(1, 'a'); // incorrect order is 
> valid as well
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to