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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • 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 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

      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.