You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Avi Kivity (Jira)" <ji...@apache.org> on 2019/09/08 08:53:00 UTC

[jira] [Created] (CASSANDRA-15317) CAST AS function vulnerable to integer overflow

Avi Kivity created CASSANDRA-15317:
--------------------------------------

             Summary: CAST AS function vulnerable to integer overflow
                 Key: CASSANDRA-15317
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15317
             Project: Cassandra
          Issue Type: Bug
          Components: CQL/Interpreter
            Reporter: Avi Kivity


 
{noformat}
cqlsh:ks1> create table bigdec (k decimal  primary key);

cqlsh:ks1> insert into bigdec (k) values (100000000000000);

cqlsh:ks1> select * from bigdec;
 k
-----------------
 100000000000000
(1 rows)

cqlsh:ks1> select cast(k as int) from bigdec;
 cast(k as int)
----------------
      276447232{noformat}
This overflow is unexpected for the user and can lead to incorrect results. Better to refuse to execute the query.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org