[Commits] Rev 3505: MDEV-498: Cassandra: Inserting a timestamp does not work on a 32-bit system in file:///data0/psergey/dev2/5.5-cassandra-r01/

Sergey Petrunya psergey at askmonty.org
Fri Aug 31 10:04:00 EEST 2012


At file:///data0/psergey/dev2/5.5-cassandra-r01/

------------------------------------------------------------
revno: 3505
revision-id: psergey at askmonty.org-20120831070359-s93t7miw28cvdi83
parent: psergey at askmonty.org-20120831064936-4ceo6hdr6hror7fl
committer: Sergey Petrunya <psergey at askmonty.org>
branch nick: 5.5-cassandra-r01
timestamp: Fri 2012-08-31 11:03:59 +0400
message:
  MDEV-498: Cassandra: Inserting a timestamp does not work on a 32-bit system
  - Make an attempt at fixing.
=== modified file 'mysql-test/r/cassandra.result'
--- a/mysql-test/r/cassandra.result	2012-08-31 06:49:36 +0000
+++ b/mysql-test/r/cassandra.result	2012-08-31 07:03:59 +0000
@@ -210,6 +210,12 @@
 rowkey	datecol
 1	2012-08-29 01:23:45
 delete from t2;
+# MDEV-498: Cassandra: Inserting a timestamp does not work on a 32-bit system
+INSERT INTO t2 VALUES (10,'2012-12-12 12:12:12');
+SELECT * FROM t2;
+rowkey	datecol
+10	2012-12-12 12:12:12
+delete from t2;
 #
 # (no MDEV#) Check that insert counters work correctly
 #

=== modified file 'mysql-test/t/cassandra.test'
--- a/mysql-test/t/cassandra.test	2012-08-31 06:49:36 +0000
+++ b/mysql-test/t/cassandra.test	2012-08-31 07:03:59 +0000
@@ -236,6 +236,11 @@
 select * from t2;
 delete from t2;
 
+--echo # MDEV-498: Cassandra: Inserting a timestamp does not work on a 32-bit system
+INSERT INTO t2 VALUES (10,'2012-12-12 12:12:12');
+SELECT * FROM t2;
+delete from t2;
+
 --echo #
 --echo # (no MDEV#) Check that insert counters work correctly
 --echo #

=== modified file 'storage/cassandra/ha_cassandra.cc'
--- a/storage/cassandra/ha_cassandra.cc	2012-08-31 06:49:36 +0000
+++ b/storage/cassandra/ha_cassandra.cc	2012-08-31 07:03:59 +0000
@@ -599,7 +599,7 @@
     ts_time= ((Field_timestamp*)field)->get_timestamp(&ts_microsec);
     
     /* Cassandra needs milliseconds-since-epoch */
-    tmp= ts_time * 1000 + ts_microsec/1000;
+    tmp= ((int64_t)ts_time) * 1000 + ts_microsec/1000;
     flip64((const char*)&tmp, (char*)&buf);
 
     *cass_data= (char*)&buf;



More information about the commits mailing list