Browse Source

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

- Make an attempt at fixing.
pull/57/head
Sergey Petrunya 13 years ago
parent
commit
12ab6a4f3c
  1. 6
      mysql-test/r/cassandra.result
  2. 5
      mysql-test/t/cassandra.test
  3. 2
      storage/cassandra/ha_cassandra.cc

6
mysql-test/r/cassandra.result

@ -210,6 +210,12 @@ select * from t2;
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
#

5
mysql-test/t/cassandra.test

@ -236,6 +236,11 @@ insert into t2 values (1, '2012-08-29 01:23:45');
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 #

2
storage/cassandra/ha_cassandra.cc

@ -599,7 +599,7 @@ public:
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;

Loading…
Cancel
Save