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

Brandon Williams updated CASSANDRA-21736:
-----------------------------------------
     Bug Category: Parent values: Correctness(12982)Level 1 values: 
Consistency(12989)
       Complexity: Normal
      Component/s: CQL/Semantics
    Discovered By: User Report
    Fix Version/s: 5.0.x
                   6.x
                   7.x
         Severity: Normal
           Status: Open  (was: Triage Needed)

> A list literal whose elements have different types is accepted, with a result 
> type that doesn't match the data
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-21736
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-21736
>             Project: Apache Cassandra
>          Issue Type: Bug
>          Components: CQL/Semantics
>            Reporter: Nadav Har'El
>            Priority: Normal
>             Fix For: 5.0.x, 6.x, 7.x
>
>
> {{CREATE TABLE ks.t (pk int, ck int, t text, PRIMARY KEY (pk, ck));
> INSERT INTO ks.t (pk, ck, t) VALUES (1, 1, 'one');
> SELECT [(CAST(pk AS BIGINT), CAST(ck AS BIGINT)), (t, WRITETIME(t))] FROM 
> ks.t;}}
> The two list elements are tuples of different types, {{(bigint, bigint)}} and 
> {{{}(text, bigint){}}}. Cassandra accepts the query, describes the result 
> type as {{list<frozen<tuple<bigint, bigint>>>}} (the first element's type), 
> but serializes the second element as {{{}(text, bigint){}}}. A driver 
> decoding the result per the declared type fails: the Python driver raises 
> "Failed decoding result column … Requested more than length of buffer" and 
> marks the connection as defunct.
> The query should be rejected, since all elements of a list must have the same 
> type. TermSelectionTest.testSelectLiteral (since "Add support for arithmetic 
> operators", 2016) asserts this query's result, but reads it inside Cassandra 
> without serializing it, so it doesn't notice. Reproduced on 5.0 and trunk 
> (6.0).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to