From fc00cf4f0f0baf63caeb096cccca6019e4f5bf50 Mon Sep 17 00:00:00 2001 From: Tomasz Grabiec Date: Tue, 10 Mar 2015 09:40:00 +0100 Subject: [PATCH] db: Do not fail when creating a table with composite partition key --- database.cc | 2 +- unimplemented.cc | 1 + unimplemented.hh | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/database.cc b/database.cc index 122e8d7f3f..a076586e49 100644 --- a/database.cc +++ b/database.cc @@ -63,7 +63,7 @@ schema::schema(sstring ks_name, sstring cf_name, std::vector partition_k thrift.partition_key_type = partition_key[0].type; } else { // TODO: the type should be composite_type - throw std::runtime_error("not implemented"); + warn(unimplemented::cause::LEGACY_COMPOSITE_KEYS); } build_columns(partition_key, column_definition::column_kind::PARTITION, _partition_key); diff --git a/unimplemented.cc b/unimplemented.cc index 8a42994a37..586b3e1a9f 100644 --- a/unimplemented.cc +++ b/unimplemented.cc @@ -25,6 +25,7 @@ std::ostream& operator<<(std::ostream& out, cause c) { case cause::COMPACT_TABLES: return out << "COMPACT_TABLES"; case cause::GOSSIP: return out << "GOSSIP"; case cause::TOKEN_RESTRICTION: return out << "TOKEN_RESTRICTION"; + case cause::LEGACY_COMPOSITE_KEYS: return out << "LEGACY_COMPOSITE_KEYS"; } assert(0); } diff --git a/unimplemented.hh b/unimplemented.hh index 7e2d9da19a..5ef917acc2 100644 --- a/unimplemented.hh +++ b/unimplemented.hh @@ -24,6 +24,7 @@ enum class cause { COMPACT_TABLES, GOSSIP, TOKEN_RESTRICTION, + LEGACY_COMPOSITE_KEYS, }; void fail(cause what) __attribute__((noreturn));