From d87fbe9eb8dd5e03bd9ee1dba80bb0157e661508 Mon Sep 17 00:00:00 2001 From: Tomasz Grabiec Date: Fri, 17 Apr 2015 14:46:38 +0200 Subject: [PATCH] cql3: Fix references to obsolete collection types The code was using the wrong version of list_type_impl and collection_type_impl. --- cql3/abstract_marker.cc | 10 ++++++---- cql3/abstract_marker.hh | 5 +---- cql3/functions/functions.cc | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/cql3/abstract_marker.cc b/cql3/abstract_marker.cc index aa93bf328c..5aa27e1450 100644 --- a/cql3/abstract_marker.cc +++ b/cql3/abstract_marker.cc @@ -37,10 +37,12 @@ namespace cql3 { if (receiver_type == nullptr) { return ::make_shared(_bind_index, receiver); } - switch (receiver_type->kind) { - case db::marshal::collection_type::collection_kind::LIST: return ::make_shared(_bind_index, receiver); - case db::marshal::collection_type::collection_kind::SET: return ::make_shared(_bind_index, receiver); - case db::marshal::collection_type::collection_kind::MAP: return ::make_shared(_bind_index, receiver); + if (&receiver_type->_kind == &collection_type_impl::kind::list) { + return ::make_shared(_bind_index, receiver); + } else if (&receiver_type->_kind == &collection_type_impl::kind::set) { + return ::make_shared(_bind_index, receiver); + } else if (&receiver_type->_kind == &collection_type_impl::kind::map) { + return ::make_shared(_bind_index, receiver); } assert(0); } diff --git a/cql3/abstract_marker.hh b/cql3/abstract_marker.hh index e6a6002df7..2907d8e7d5 100644 --- a/cql3/abstract_marker.hh +++ b/cql3/abstract_marker.hh @@ -29,9 +29,6 @@ #include "cql3/column_specification.hh" #include "cql3/term.hh" -#include "db/marshal/collection_type.hh" -#include "db/marshal/list_type.hh" - namespace cql3 { /** @@ -94,7 +91,7 @@ public: private: static ::shared_ptr make_in_receiver(::shared_ptr receiver) { auto in_name = ::make_shared(sstring("in(") + receiver->name->to_string() + sstring(")"), true); - return ::make_shared(receiver->ks_name, receiver->cf_name, in_name, db::marshal::list_type::get_instance(receiver->type, false)); + return ::make_shared(receiver->ks_name, receiver->cf_name, in_name, list_type_impl::get_instance(receiver->type, false)); } public: diff --git a/cql3/functions/functions.cc b/cql3/functions/functions.cc index 6bcfc5cfd4..eeb92061f8 100644 --- a/cql3/functions/functions.cc +++ b/cql3/functions/functions.cc @@ -320,7 +320,7 @@ function_call::contains_bind_marker() const { shared_ptr function_call::make_terminal(shared_ptr fun, bytes_opt result, serialization_format sf) { - if (!dynamic_pointer_cast>(fun->return_type())) { + if (!dynamic_pointer_cast(fun->return_type())) { return ::make_shared(std::move(result)); }