[MDEV-498] Cassandra: Inserting a timestamp does not work on a 32-bit system Created: 2012-08-30  Updated: 2012-08-31  Resolved: 2012-08-31

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: 10.0.0

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-431 Cassandra storage engine Closed

 Description   

Test case:

# 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:

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:

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):

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



 Comments   
Comment by Sergei Petrunia [ 2012-08-31 ]

Probably fixed. Please re-open if still repeatable.

Generated at Thu Feb 08 06:29:11 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.