cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jaume M (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-13516) Message error for Duration types is confusing
Date Thu, 11 May 2017 17:17:04 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-13516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16006796#comment-16006796
] 

Jaume M commented on CASSANDRA-13516:
-------------------------------------

Looks like this is a duplicate of CASSANDRA-13218. Closing it.

> Message error for Duration types is confusing
> ---------------------------------------------
>
>                 Key: CASSANDRA-13516
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13516
>             Project: Cassandra
>          Issue Type: Bug
>         Environment: C* 3.11
>            Reporter: Jaume M
>
> {code}
> from cassandra.util import Duration
> from cassandra.cluster import Cluster
> cluster = Cluster(['127.0.0.1'])
> session = cluster.connect()
> # Assume table was created earlier like this:
> # CREATE TABLE simplex.t1 (f1 int primary key, f2 duration);
> prepared = session.prepare("""
>      INSERT INTO simplex.t1 (f1, f2)
>      VALUES (?, ?)
>      """)
> d = Duration(int("7FFFFFFF", 16), int("8FFFFFF0", 16), 0)
> session.execute(prepared, (1, d))
> results = session.execute("SELECT * FROM simplex.t1")
> assert d == results[0][1]
> {code}
> I this example I get the error: cassandra.InvalidRequest: Error from server: code=2200
[Invalid query] message="The duration months, days and nanoseconds must be all of the same
sign (2147483647, -1879048208, 0)"
>  , but maybe it should be something about the number being too big? Also if we use the
Duration value:
> {code}
> d = Duration(int("8FFFFFF0", 16), int("8FFFFFF0", 16), 0)
> {code}
> the script ends fine and there is no AssertionError, so not sure why the sign is different
in the first example.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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


Mime
View raw message