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

Cassandra: TRUNCATE TABLE on a Cassandra table does not remove rows

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.0.0
    • Component/s: None
    • Labels:
      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 cf1 ( pk bigint primary key, a bigint );
      EOF
      
      --system cqlsh -3 -f $MYSQLTEST_VARDIR/test.cql
      
      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (rowkey BIGINT PRIMARY KEY, a BIGINT) ENGINE=CASSANDRA
        thrift_host='localhost' keyspace='bug_ks' column_family = 'cf1';
      
      INSERT INTO t1 VALUES (1,1),(2,2);
      SELECT * FROM t1;
      TRUNCATE TABLE t1;
      SELECT * FROM t1;
      
      # Cleanup
      DROP TABLE t1;
      

      Current result:

      DROP TABLE IF EXISTS t1;
      Warnings:
      Note    1051    Unknown table 't1'
      CREATE TABLE t1 (rowkey BIGINT PRIMARY KEY, a BIGINT) ENGINE=CASSANDRA
      thrift_host='localhost' keyspace='bug_ks' column_family = 'cf1';
      INSERT INTO t1 VALUES (1,1),(2,2);
      SELECT * FROM t1;
      rowkey  a
      1       1
      2       2
      TRUNCATE TABLE t1;
      SELECT * FROM t1;
      rowkey  a
      1       1
      2       2
      DROP TABLE t1;
      

      bzr version-info:

      revision-id: psergey@askmonty.org-20120823121528-1p4qx0yzc7ktdcc9
      date: 2012-08-23 16:15:28 +0400
      build-date: 2012-08-24 00:05:46 +0400
      revno: 3493
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              psergey Sergei Petrunia added a comment -

              Fix pushed.

              Show
              psergey Sergei Petrunia added a comment - Fix pushed.

                People

                • Assignee:
                  psergey Sergei Petrunia
                  Reporter:
                  elenst Elena Stepanova
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 30 minutes
                    30m