We're updating the issue view to help you get more done. 

Cassandra: Inserting a timestamp does not work on a 32-bit system

Description

Test case:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 # Make sure your cassandra is running, # and thrift is on LD_LIBRARY_PATH, # and cqlsh is on the system PATH --source include/have_cassandra.inc --remove_files_wildcard $MYSQLTEST_VARDIR test.cql --write_file $MYSQLTEST_VARDIR/test.cql DROP KEYSPACE bug_ks; EOF --error 0,1,2 --system cqlsh -3 -f $MYSQLTEST_VARDIR/test.cql --remove_file $MYSQLTEST_VARDIR/test.cql --write_file $MYSQLTEST_VARDIR/test.cql CREATE KEYSPACE bug_ks WITH strategy_class = 'org.apache.cassandra.locator.SimpleStrategy' AND strategy_options:replication_factor='1'; USE bug_ks; CREATE COLUMNFAMILY cf (id bigint PRIMARY KEY, t timestamp); EOF --system cqlsh -3 -f $MYSQLTEST_VARDIR/test.cql --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings CREATE TABLE t1 (id bigint PRIMARY KEY, t timestamp) ENGINE=CASSANDRA DEFAULT CHARSET=latin1 thrift_host='localhost' keyspace='bug_ks' column_family = 'cf'; INSERT INTO t1 VALUES (1,'2012-12-12 12:12:12'); SELECT * FROM t1; --echo # Inserting '2012-12-12 12:12:12' into Cassandra through cqlsh --echo # and checking what we have there --remove_file $MYSQLTEST_VARDIR/test.cql --write_file $MYSQLTEST_VARDIR/test.cql USE bug_ks; INSERT INTO cf (id,t) VALUES (2,'2012-12-12 12:12:12'); SELECT * FROM cf; EOF --system cqlsh -3 -f $MYSQLTEST_VARDIR/test.cql SELECT * FROM t1; # Cleanup DROP TABLE t1;

Output on a 32-bit machine:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 DROP TABLE IF EXISTS t1; CREATE TABLE t1 (id bigint PRIMARY KEY, t timestamp) ENGINE=CASSANDRA DEFAULT CHARSET=latin1 thrift_host='localhost' keyspace='bug_ks' column_family = 'cf'; INSERT INTO t1 VALUES (1,'2012-12-12 12:12:12'); SELECT * FROM t1; id t 1 1970-01-28 17:33:53 # Inserting '2012-12-12 12:12:12' into Cassandra through cqlsh # and checking what we have there id | t ----+-------------------------- 1 | 1970-01-28 17:33:53+0000 2 | 2012-12-12 12:12:12+0000 SELECT * FROM t1; id t 1 1970-01-28 17:33:53 2 2012-12-12 12:12:12 DROP TABLE t1;

Output on a 64-bit machine:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 DROP TABLE IF EXISTS t1; CREATE TABLE t1 (id bigint PRIMARY KEY, t timestamp) ENGINE=CASSANDRA DEFAULT CHARSET=latin1 thrift_host='localhost' keyspace='bug_ks' column_family = 'cf'; INSERT INTO t1 VALUES (1,'2012-12-12 12:12:12'); SELECT * FROM t1; id t 1 2012-12-12 12:12:12 # Inserting '2012-12-12 12:12:12' into Cassandra through cqlsh # and checking what we have there id | t ----+-------------------------- 1 | 2012-12-12 12:12:12+0000 2 | 2012-12-12 12:12:12+0000 SELECT * FROM t1; id t 1 2012-12-12 12:12:12 2 2012-12-12 12:12:12 DROP TABLE t1;

bzr version-info (on both):

1 2 3 4 revision-id: psergey@askmonty.org-20120829162711-cdqfvic3os2rkd0o date: 2012-08-29 20:27:11 +0400 build-date: 2012-08-30 04:59:51 +0400 revno: 3503

Environment

None

Status

Assignee

Sergei Petrunia

Reporter

Elena Stepanova

Fix versions

Priority

Major