diff --git a/types.cc b/types.cc index 8c29c4058d..0172e21b66 100644 --- a/types.cc +++ b/types.cc @@ -127,7 +127,7 @@ struct long_type_impl : integer_type_impl { }; struct string_type_impl : public abstract_type { - string_type_impl(sstring name, shared_ptr cql3_type) + string_type_impl(sstring name, std::function()> cql3_type) : abstract_type(name), _cql3_type(cql3_type) {} virtual void serialize(const boost::any& value, bytes::iterator& out) override { auto& v = boost::any_cast(value); @@ -160,9 +160,9 @@ struct string_type_impl : public abstract_type { return sstring(b); } virtual ::shared_ptr as_cql3_type() override { - return _cql3_type; + return _cql3_type(); } - shared_ptr _cql3_type; + std::function()> _cql3_type; }; struct bytes_type_impl final : public abstract_type { @@ -1386,9 +1386,9 @@ list_type_impl::to_value(mutation_view mut, serialization_format sf) { thread_local const shared_ptr int32_type(make_shared()); thread_local const shared_ptr long_type(make_shared()); -thread_local const shared_ptr ascii_type(make_shared("ascii", cql3::native_cql3_type::ascii)); +thread_local const shared_ptr ascii_type(make_shared("ascii", [] { return cql3::native_cql3_type::ascii; })); thread_local const shared_ptr bytes_type(make_shared()); -thread_local const shared_ptr utf8_type(make_shared("utf8", cql3::native_cql3_type::text)); +thread_local const shared_ptr utf8_type(make_shared("utf8", [] { return cql3::native_cql3_type::text; })); thread_local const shared_ptr boolean_type(make_shared()); thread_local const shared_ptr date_type(make_shared()); thread_local const shared_ptr timeuuid_type(make_shared());