Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-498

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 10.0.0
    • None
    • None

    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

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.