From 869826d770e844608e5871a40610f676b8e0754b Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Tue, 28 Aug 2012 12:53:33 +0400 Subject: MDEV-480: TRUNCATE TABLE on a Cassandra table does not remove rows - Remove HTON_CAN_RECREATE flag, re-create won't delete rows in cassandra. --- storage/cassandra/ha_cassandra.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'storage') diff --git a/storage/cassandra/ha_cassandra.cc b/storage/cassandra/ha_cassandra.cc index 9e94c848988..5b1a411be6a 100644 --- a/storage/cassandra/ha_cassandra.cc +++ b/storage/cassandra/ha_cassandra.cc @@ -142,7 +142,12 @@ static int cassandra_init_func(void *p) cassandra_hton->state= SHOW_OPTION_YES; cassandra_hton->create= cassandra_create_handler; - cassandra_hton->flags= HTON_CAN_RECREATE; + /* + Don't specify HTON_CAN_RECREATE in flags. re-create is used by TRUNCATE + TABLE to create an *empty* table from scratch. Cassandra table won't be + emptied if re-created. + */ + cassandra_hton->flags= 0; cassandra_hton->table_options= cassandra_table_option_list; //cassandra_hton->field_options= example_field_option_list; cassandra_hton->field_options= NULL; -- cgit v1.2.1