cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Rhoden <jacob.rho...@me.com>
Subject null date bug? Not sure if its cassandra 2.0.5 or the gocql (golang) driver.
Date Sat, 17 May 2014 01:30:15 GMT
Im noticing the following strange behaviour when I do a query on a table:

cqlsh:mykeyspace> select uuid, discontinued_from from mytable;

 uuid                                 | discontinued_from
--------------------------------------+--------------------------
 b838a632-dd61-11e3-a32e-b8f6b11b1965 |          -6795364578.871
 b838e9b4-dd61-11e3-a330-b8f6b11b1965 |          -6795364578.871
 b838c725-dd61-11e3-a32f-b8f6b11b1965 |          -6795364578.871
 b8390aeb-dd61-11e3-a331-b8f6b11b1965 | 2014-01-01 10:00:00+1100
 b83840b7-dd61-11e3-a32c-b8f6b11b1965 |          -6795364578.871
 b83882fc-dd61-11e3-a32d-b8f6b11b1965 |          -6795364578.871

(6 rows)

Failed to format value -6795364578.871 as timestamp: year out of range
Failed to format value -6795364578.871 as timestamp: year out of range
3 more decoding errors suppressed.

The discontinued from field is being updated with a golang time.Time variable that is either
correctly initialised, or left as null, i.e.:

err := cql.Query("update mytable set name=?, discontinued_from, updated=? where uuid=?", name,
discontinuedFrom, time.Now().UnixNano(), s.Id).Exec()

I would have expected updating a timestamp with null value should result in a null in the
row. Is this a bug in gocql? Or am I misunderstanding how null can be used? (Is it not possible
or allowed to set something to null??)

Thanks,
Jacob



Mime
View raw message