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: [email protected]
For additional commands, e-mail: [email protected]