diff --git a/configure.py b/configure.py index f93464353b..fe90d138b6 100755 --- a/configure.py +++ b/configure.py @@ -225,6 +225,8 @@ deps = { 'log.cc', 'cql3/abstract_marker.cc', 'cql3/cql3.cc', + 'cql3/cql3_type.cc', + 'cql3/functions/functions.cc', 'thrift/handler.cc', 'thrift/server.cc', 'utils/murmur_hash.cc', diff --git a/cql3/cql3.cc b/cql3/cql3.cc index 635f85e25a..b53da41990 100644 --- a/cql3/cql3.cc +++ b/cql3/cql3.cc @@ -18,6 +18,7 @@ #include "functions/function_call.hh" #include "functions/uuid_fcts.hh" #include "functions/bytes_conversion_fcts.hh" +#include "functions/functions.hh" #include "statements/alter_keyspace_statement.hh" #include "statements/alter_type_statement.hh" @@ -46,4 +47,5 @@ #include "term.hh" #include "sets.hh" #include "cql3_row.hh" +#include "cql3_type.hh" #include "attributes.hh" diff --git a/cql3/cql3_type.cc b/cql3/cql3_type.cc new file mode 100644 index 0000000000..2879994a01 --- /dev/null +++ b/cql3/cql3_type.cc @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2014 Cloudius Systems, Ltd. + */ + +#include "cql3_type.hh" + +namespace cql3 { + +thread_local shared_ptr native_cql3_type::ascii = make("ascii", ascii_type); +thread_local shared_ptr native_cql3_type::bigint = make("bigint", long_type); +thread_local shared_ptr native_cql3_type::blob = make("blob", bytes_type); +thread_local shared_ptr native_cql3_type::boolean = make("boolean", boolean_type); +//thread_local shared_ptr native_cql3_type::double = make("double", double_type); +//thread_local shared_ptr native_cql3_type::float = make("float", float_type); +thread_local shared_ptr native_cql3_type::int_ = make("int", int32_type); +thread_local shared_ptr native_cql3_type::text = make("text", utf8_type); +thread_local shared_ptr native_cql3_type::timestamp = make("timestamp", timestamp_type); +thread_local shared_ptr native_cql3_type::uuid = make("uuid", uuid_type); +thread_local shared_ptr native_cql3_type::varchar = make("varchar", utf8_type); +thread_local shared_ptr native_cql3_type::timeuuid = make("timeuuid", timeuuid_type); + +const std::vector>& +native_cql3_type::values() { + static thread_local std::vector> v = { + native_cql3_type::ascii, + native_cql3_type::bigint, + native_cql3_type::blob, + native_cql3_type::boolean, +#if 0 + native_cql3_type::double_, + native_cql3_type::float_, +#endif + native_cql3_type::int_, + native_cql3_type::text, + native_cql3_type::timestamp, + native_cql3_type::uuid, + native_cql3_type::varchar, + native_cql3_type::timeuuid, + }; + return v; +} + +} + + diff --git a/cql3/CQL3Type.java b/cql3/cql3_type.hh similarity index 90% rename from cql3/CQL3Type.java rename to cql3/cql3_type.hh index 98d1b15578..78a300b1b0 100644 --- a/cql3/CQL3Type.java +++ b/cql3/cql3_type.hh @@ -15,70 +15,65 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.cassandra.cql3; -import java.util.ArrayList; -import java.util.List; +/* + * Modified by Cloudius Systems + * + * Copyright 2015 Cloudius Systems + */ -import org.apache.cassandra.config.KSMetaData; -import org.apache.cassandra.config.Schema; -import org.apache.cassandra.db.marshal.*; -import org.apache.cassandra.exceptions.InvalidRequestException; -import org.apache.cassandra.exceptions.ConfigurationException; -import org.apache.cassandra.exceptions.SyntaxException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +#pragma once -public interface CQL3Type -{ - static final Logger logger = LoggerFactory.getLogger(CQL3Type.class); +#include "database.hh" +#include "exceptions/exceptions.hh" +#include - public boolean isCollection(); - public AbstractType getType(); +namespace cql3 { - public enum Native implements CQL3Type - { - ASCII (AsciiType.instance), - BIGINT (LongType.instance), - BLOB (BytesType.instance), - BOOLEAN (BooleanType.instance), +class cql3_type { + sstring _name; + data_type _type; +public: + cql3_type(sstring name, data_type type) : _name(std::move(name)), _type(std::move(type)) {} + virtual ~cql3_type() {} + virtual bool is_collection() const = 0; + data_type get_type() const { return _type; } + sstring to_string() const { return _name; } +}; + +class native_cql3_type : public cql3_type { + static shared_ptr make(sstring name, data_type type) { + return make_shared(std::move(name), std::move(type)); + } +public: + static thread_local shared_ptr ascii; + static thread_local shared_ptr bigint; + static thread_local shared_ptr blob; + static thread_local shared_ptr boolean; + //static thread_local shared_ptr double; + //static thread_local shared_ptr float; + static thread_local shared_ptr int_; + static thread_local shared_ptr text; + static thread_local shared_ptr timestamp; + static thread_local shared_ptr uuid; + static thread_local shared_ptr varchar; + static thread_local shared_ptr timeuuid; + +#if 0 COUNTER (CounterColumnType.instance), DECIMAL (DecimalType.instance), - DOUBLE (DoubleType.instance), - FLOAT (FloatType.instance), INET (InetAddressType.instance), - INT (Int32Type.instance), - TEXT (UTF8Type.instance), - TIMESTAMP(TimestampType.instance), - UUID (UUIDType.instance), - VARCHAR (UTF8Type.instance), VARINT (IntegerType.instance), - TIMEUUID (TimeUUIDType.instance); - - private final AbstractType type; - - private Native(AbstractType type) - { - this.type = type; - } - - public boolean isCollection() - { - return false; - } - - public AbstractType getType() - { - return type; - } - - @Override - public String toString() - { - return super.toString().toLowerCase(); - } +#endif + static const std::vector>& values(); +public: + using cql3_type::cql3_type; + virtual bool is_collection() const override { + return false; } +}; +#if 0 public static class Custom implements CQL3Type { private final AbstractType type; @@ -591,4 +586,6 @@ public interface CQL3Type } } } +#endif + } diff --git a/cql3/functions/aggregate_fcts.hh b/cql3/functions/aggregate_fcts.hh index a680ddf87d..4e066a68bd 100644 --- a/cql3/functions/aggregate_fcts.hh +++ b/cql3/functions/aggregate_fcts.hh @@ -24,6 +24,9 @@ #pragma once +#include "aggregate_function.hh" +#include "native_aggregate_function.hh" + namespace cql3 { namespace functions { @@ -50,7 +53,8 @@ public: * The function used to count the number of rows of a result set. This function is called when COUNT(*) or COUNT(1) * is specified. */ -std::unique_ptr +inline +shared_ptr make_count_rows_function() { return make_native_aggregate_function_using("countRows", long_type); } @@ -62,7 +66,7 @@ public: virtual void reset() override { _sum = {}; } - virtual opt_bytes compute() override { + virtual opt_bytes compute(int protocol_version) override { return data_type_for()->decompose(_sum); } virtual void add_input(int protocol_version, const std::vector& values) override { @@ -84,9 +88,10 @@ public: template -std::unique_ptr +inline +shared_ptr make_sum_function() { - return std::make_unique>(); + return make_shared>(); } template @@ -98,19 +103,19 @@ public: _sum = {}; _count = 0; } - virtual opt_bytes compute() override { + virtual opt_bytes compute(int protocol_version) override { Type ret = 0; if (_count) { ret = _sum / _count; } - return data_type_for().decompose(ret); + return data_type_for()->decompose(ret); } virtual void add_input(int protocol_version, const std::vector& values) override { if (!values[0]) { return; } ++_count; - _sum += boost::any_cast(data_type_for().compose(*values[0])); + _sum += boost::any_cast(data_type_for()->compose(*values[0])); } }; @@ -124,9 +129,10 @@ public: }; template -std::unique_ptr +inline +shared_ptr make_avg_function() { - return std::make_unique>(); + return make_shared>(); } template @@ -171,9 +177,9 @@ public: * @return a MAX function for the specified type. */ template -std::unique_ptr +shared_ptr make_max_function() { - return std::make_unique>(); + return shared_ptr>(); } template @@ -183,20 +189,20 @@ public: virtual void reset() override { _min = {}; } - virtual opt_bytes compute() override { + virtual opt_bytes compute(int protocol_version) override { if (!_min) { return {}; } - return data_type_for().decompose(*_min); + return data_type_for()->decompose(*_min); } virtual void add_input(int protocol_version, const std::vector& values) override { if (!values[0]) { return; } + auto val = boost::any_cast(data_type_for()->compose(*values[0])); if (!_min) { - _min = values[0]; + _min = val; } else { - auto val = boost::any_cast(data_type_for().compose(*values[0])); _min = std::min(*_min, val); } } @@ -219,9 +225,9 @@ public: * @return a MIN function for the specified type. */ template -std::unique_ptr +shared_ptr make_min_function() { - return std::make_unique>(); + return make_shared>(); } @@ -232,7 +238,7 @@ public: virtual void reset() override { _count = 0; } - virtual opt_bytes compute() override { + virtual opt_bytes compute(int protocol_version) override { return long_type->decompose(_count); } virtual void add_input(int protocol_version, const std::vector& values) override { @@ -259,9 +265,9 @@ public: * @return a COUNT function for the specified type. */ template -std::unique_ptr +shared_ptr make_count_function() { - return std::make_unique>(); + return make_shared>(); } } diff --git a/cql3/functions/bytes_conversion_fcts.hh b/cql3/functions/bytes_conversion_fcts.hh index 78655821ba..64f9daa483 100644 --- a/cql3/functions/bytes_conversion_fcts.hh +++ b/cql3/functions/bytes_conversion_fcts.hh @@ -22,8 +22,11 @@ * Copyright 2015 Cloudius Systems */ +#pragma once + #include "native_scalar_function.hh" #include "exceptions/exceptions.hh" +#include "core/print.hh" namespace cql3 { @@ -33,7 +36,7 @@ namespace functions { // bytes internally. They only "trick" the type system. inline -std::unique_ptr +shared_ptr make_to_blob_function(data_type from_type) { // FIXME: use cql3 type name auto name = from_type->name() + "asblob"; @@ -44,7 +47,7 @@ make_to_blob_function(data_type from_type) { } inline -std::unique_ptr +shared_ptr make_from_blob_function(data_type to_type) { // FIXME: use cql3 type name sstring name = sstring("blobas") + to_type->name(); @@ -67,7 +70,7 @@ make_from_blob_function(data_type to_type) { } inline -std::unique_ptr +shared_ptr make_varchar_as_blob_fct() { return make_native_scalar_function("varcharasblob", bytes_type, { utf8_type }, [] (int protocol_version, const std::vector& parameters) { @@ -76,7 +79,7 @@ make_varchar_as_blob_fct() { } inline -std::unique_ptr +shared_ptr make_blob_as_varchar_fct() { return make_native_scalar_function("blobasvarchar", utf8_type, { bytes_type }, [] (int protocol_version, const std::vector& parameters) { diff --git a/cql3/functions/function.hh b/cql3/functions/function.hh index aa9b53c0d2..90f5189c32 100644 --- a/cql3/functions/function.hh +++ b/cql3/functions/function.hh @@ -25,6 +25,7 @@ #ifndef CQL3_FUNCTIONS_FUNCTION_HH #define CQL3_FUNCTIONS_FUNCTION_HH +#include "function_name.hh" #include "database.hh" #include #include @@ -69,6 +70,7 @@ protected: friend std::ostream& operator<<(std::ostream& os, const function& f); }; +inline std::ostream& operator<<(std::ostream& os, const function& f) { f.print(os); diff --git a/cql3/functions/function_name.hh b/cql3/functions/function_name.hh index 39be8a44d6..6434146e56 100644 --- a/cql3/functions/function_name.hh +++ b/cql3/functions/function_name.hh @@ -65,6 +65,7 @@ public: } }; +inline std::ostream& operator<<(std::ostream& os, const function_name& fn) { if (!fn.keyspace.empty()) { os << fn.keyspace << "."; diff --git a/cql3/functions/functions.cc b/cql3/functions/functions.cc new file mode 100644 index 0000000000..59645841b0 --- /dev/null +++ b/cql3/functions/functions.cc @@ -0,0 +1,15 @@ +/* + * Copyright (C) 2014 Cloudius Systems, Ltd. + */ + +#include "functions.hh" + +namespace cql3 { +namespace functions { + +thread_local std::unordered_multimap> functions::_declared = init(); + +} +} + + diff --git a/cql3/functions/Functions.java b/cql3/functions/functions.hh similarity index 74% rename from cql3/functions/Functions.java rename to cql3/functions/functions.hh index b55ebc5e92..f92fd82d77 100644 --- a/cql3/functions/Functions.java +++ b/cql3/functions/functions.hh @@ -15,79 +15,101 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.cassandra.cql3.functions; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; +/* + * Modified by Cloudius Systems + * + * Copyright 2015 Cloudius Systems + */ -import com.google.common.collect.ArrayListMultimap; +#pragma once -import org.apache.cassandra.config.Schema; -import org.apache.cassandra.cql3.*; -import org.apache.cassandra.db.marshal.AbstractType; -import org.apache.cassandra.exceptions.InvalidRequestException; -import org.apache.cassandra.service.IMigrationListener; -import org.apache.cassandra.service.MigrationManager; +#include "function.hh" +#include "aggregate_fcts.hh" +#include "time_uuid_fcts.hh" +#include "uuid_fcts.hh" +#include "bytes_conversion_fcts.hh" +#include "aggregate_fcts.hh" +#include "bytes_conversion_fcts.hh" +#include "cql3/assignment_testable.hh" +#include "cql3/cql3_type.hh" +#include -public abstract class Functions -{ +namespace cql3 { + +namespace functions { + +#if 0 // We special case the token function because that's the only function whose argument types actually // depend on the table on which the function is called. Because it's the sole exception, it's easier // to handle it as a special case. private static final FunctionName TOKEN_FUNCTION_NAME = FunctionName.nativeFunction("token"); +#endif - private Functions() {} +class functions { + static thread_local std::unordered_multimap> _declared; +private: + static std::unordered_multimap> init() { + std::unordered_multimap> ret; + auto declare = [&ret] (shared_ptr f) { ret.emplace(f->name(), std::move(f)); }; + declare(aggregate_fcts::make_count_rows_function()); + declare(time_uuid_fcts::make_now_fct()); + declare(time_uuid_fcts::make_min_timeuuid_fct()); + declare(time_uuid_fcts::make_max_timeuuid_fct()); + declare(time_uuid_fcts::make_date_of_fct()); + declare(time_uuid_fcts::make_unix_timestamp_of_fcf()); + declare(make_uuid_fct()); - private static final ArrayListMultimap declared = ArrayListMultimap.create(); - - static - { - declare(AggregateFcts.countRowsFunction); - declare(TimeuuidFcts.nowFct); - declare(TimeuuidFcts.minTimeuuidFct); - declare(TimeuuidFcts.maxTimeuuidFct); - declare(TimeuuidFcts.dateOfFct); - declare(TimeuuidFcts.unixTimestampOfFct); - declare(UuidFcts.uuidFct); - - for (CQL3Type type : CQL3Type.Native.values()) - { + for (auto&& type : native_cql3_type::values()) { // Note: because text and varchar ends up being synonimous, our automatic makeToBlobFunction doesn't work // for varchar, so we special case it below. We also skip blob for obvious reasons. - if (type == CQL3Type.Native.VARCHAR || type == CQL3Type.Native.BLOB) + if (type == native_cql3_type::varchar || type == native_cql3_type::blob) { continue; + } - declare(BytesConversionFcts.makeToBlobFunction(type.getType())); - declare(BytesConversionFcts.makeFromBlobFunction(type.getType())); - - declare(AggregateFcts.makeCountFunction(type.getType())); - declare(AggregateFcts.makeMaxFunction(type.getType())); - declare(AggregateFcts.makeMinFunction(type.getType())); + declare(make_to_blob_function(type->get_type())); + declare(make_from_blob_function(type->get_type())); } - declare(BytesConversionFcts.VarcharAsBlobFct); - declare(BytesConversionFcts.BlobAsVarcharFact); - declare(AggregateFcts.sumFunctionForInt32); - declare(AggregateFcts.sumFunctionForLong); + declare(aggregate_fcts::make_count_function()); + declare(aggregate_fcts::make_max_function()); + declare(aggregate_fcts::make_min_function()); + + declare(aggregate_fcts::make_count_function()); + declare(aggregate_fcts::make_max_function()); + declare(aggregate_fcts::make_min_function()); + + //FIXME: + //declare(aggregate_fcts::make_count_function()); + //declare(aggregate_fcts::make_max_function()); + //declare(aggregate_fcts::make_min_function()); + + // FIXME: more count/min/max + + declare(make_varchar_as_blob_fct()); + declare(make_blob_as_varchar_fct()); + declare(aggregate_fcts::make_sum_function()); + declare(aggregate_fcts::make_sum_function()); + declare(aggregate_fcts::make_avg_function()); + declare(aggregate_fcts::make_avg_function()); +#if 0 declare(AggregateFcts.sumFunctionForFloat); declare(AggregateFcts.sumFunctionForDouble); declare(AggregateFcts.sumFunctionForDecimal); declare(AggregateFcts.sumFunctionForVarint); - declare(AggregateFcts.avgFunctionForInt32); - declare(AggregateFcts.avgFunctionForLong); declare(AggregateFcts.avgFunctionForFloat); declare(AggregateFcts.avgFunctionForDouble); declare(AggregateFcts.avgFunctionForVarint); declare(AggregateFcts.avgFunctionForDecimal); +#endif + // also needed for smp: +#if 0 MigrationManager.instance.register(new FunctionsMigrationListener()); +#endif + return ret; } - private static void declare(Function fun) - { - declared.put(fun.name(), fun); - } - +#if 0 public static ColumnSpecification makeArgSpec(String receiverKs, String receiverCf, Function fun, int i) { return new ColumnSpecification(receiverKs, @@ -95,20 +117,19 @@ public abstract class Functions new ColumnIdentifier("arg" + i + "(" + fun.name().toString().toLowerCase() + ")", true), fun.argTypes().get(i)); } - - public static int getOverloadCount(FunctionName name) - { - return declared.get(name).size(); +#endif + static int get_overload_count(const function_name& name) { + return _declared.count(name); } - public static Function get(String keyspace, - FunctionName name, - List providedArgs, - String receiverKs, - String receiverCf) - throws InvalidRequestException - { - if (name.hasKeyspace() + static shared_ptr get(const sstring& keyspace, + const function_name& name, + const std::vector>& provided_args, + const sstring& receiver_ks, + const sstring& receiver_cf) { +#if 0 + // later + if (name.has_keyspace() ? name.equals(TOKEN_FUNCTION_NAME) : name.name.equals(TOKEN_FUNCTION_NAME.name)) return new TokenFct(Schema.instance.getCFMetaData(receiverKs, receiverCf)); @@ -164,24 +185,30 @@ public abstract class Functions name, toString(compatibles))); return compatibles.get(0); +#endif + abort(); } - public static List find(FunctionName name) - { - return declared.get(name); - } - - public static Function find(FunctionName name, List> argTypes) - { - assert name.hasKeyspace() : "function name not fully qualified"; - for (Function f : declared.get(name)) - { - if (typeEquals(f.argTypes(), argTypes)) - return f; + static std::vector> find(const function_name& name) { + auto range = _declared.equal_range(name); + std::vector> ret; + for (auto i = range.first; i != range.second; ++i) { + ret.push_back(i->second); } - return null; + return ret; } + static shared_ptr find(const function_name& name, const std::vector& arg_types) { + assert(name.has_keyspace()); // : "function name not fully qualified"; + for (auto&& f : find(name)) { + if (type_equals(f->arg_types(), arg_types)) { + return f; + } + } + return {}; + } + +#if 0 // This method and matchArguments are somewhat duplicate, but this method allows us to provide more precise errors in the common // case where there is no override for a given function. This is thus probably worth the minor code duplication. private static void validateTypes(String keyspace, @@ -292,16 +319,21 @@ public abstract class Functions return t1.asCQL3Type().toString().equals(t2.asCQL3Type().toString()); } - public static boolean typeEquals(List> t1, List> t2) - { +#endif + + static bool type_equals(const std::vector& t1, const std::vector& t2) { +#if 0 if (t1.size() != t2.size()) return false; for (int i = 0; i < t1.size(); i ++) if (!typeEquals(t1.get(i), t2.get(i))) return false; return true; +#endif + abort(); } +#if 0 private static class FunctionsMigrationListener implements IMigrationListener { public void onCreateKeyspace(String ksName) { } @@ -326,4 +358,8 @@ public abstract class Functions public void onDropFunction(String ksName, String functionName) { } public void onDropAggregate(String ksName, String aggregateName) { } } +#endif +}; + +} } diff --git a/cql3/functions/native_aggregate_function.hh b/cql3/functions/native_aggregate_function.hh index 6efe634f4a..92b702f478 100644 --- a/cql3/functions/native_aggregate_function.hh +++ b/cql3/functions/native_aggregate_function.hh @@ -27,6 +27,7 @@ #include "database.hh" #include "native_function.hh" +#include "core/shared_ptr.hh" namespace cql3 { namespace functions { @@ -59,9 +60,9 @@ public: }; template -std::unique_ptr +shared_ptr make_native_aggregate_function_using(sstring name, shared_ptr type) { - return std::make_unique>(name, type); + return ::make_shared>(name, type); } diff --git a/cql3/functions/native_scalar_function.hh b/cql3/functions/native_scalar_function.hh index 8ab7be84fc..834507a3e2 100644 --- a/cql3/functions/native_scalar_function.hh +++ b/cql3/functions/native_scalar_function.hh @@ -27,6 +27,7 @@ #include "native_function.hh" #include "scalar_function.hh" +#include "core/shared_ptr.hh" namespace cql3 { namespace functions { @@ -63,12 +64,12 @@ public: }; template -std::unique_ptr +shared_ptr make_native_scalar_function(sstring name, data_type return_type, std::vector args_type, Func&& func) { - return std::make_unique>(std::move(name), + return ::make_shared>(std::move(name), std::move(return_type), std::move(args_type), std::forward(func)); diff --git a/cql3/functions/time_uuid_fcts.hh b/cql3/functions/time_uuid_fcts.hh index daf7c4d1f3..bb223618c0 100644 --- a/cql3/functions/time_uuid_fcts.hh +++ b/cql3/functions/time_uuid_fcts.hh @@ -36,7 +36,7 @@ namespace functions { namespace time_uuid_fcts { inline -std::unique_ptr +shared_ptr make_now_fct() { return make_native_scalar_function("now", timeuuid_type, {}, [] (int protocol_version, const std::vector& values) { @@ -45,7 +45,7 @@ make_now_fct() { } inline -std::unique_ptr +shared_ptr make_min_timeuuid_fct() { return make_native_scalar_function("mintimeuuid", timeuuid_type, { timestamp_type }, [] (int protocol_version, const std::vector& values) { @@ -66,7 +66,7 @@ make_min_timeuuid_fct() { } inline -std::unique_ptr +shared_ptr make_max_timeuuid_fct() { return make_native_scalar_function("maxtimeuuid", timeuuid_type, { timestamp_type }, [] (int protocol_version, const std::vector& values) { @@ -87,7 +87,7 @@ make_max_timeuuid_fct() { } inline -std::unique_ptr +shared_ptr make_date_of_fct() { return make_native_scalar_function("dateof", timestamp_type, { timeuuid_type }, [] (int protocol, const std::vector& values) { @@ -102,7 +102,7 @@ make_date_of_fct() { } inline -std::unique_ptr +shared_ptr make_unix_timestamp_of_fcf() { return make_native_scalar_function("unixtimestampof", long_type, { timeuuid_type }, [] (int protocol, const std::vector& values) { diff --git a/cql3/functions/uuid_fcts.hh b/cql3/functions/uuid_fcts.hh index e47a3460f3..7c8d25f5c7 100644 --- a/cql3/functions/uuid_fcts.hh +++ b/cql3/functions/uuid_fcts.hh @@ -22,6 +22,8 @@ * Copyright 2015 Cloudius Systems */ +#pragma once + #include "database.hh" #include "native_scalar_function.hh" #include "utils/UUID.hh" @@ -31,7 +33,7 @@ namespace cql3 { namespace functions { inline -std::unique_ptr +shared_ptr make_uuid_fct() { return make_native_scalar_function("uuid", uuid_type, {}, [] (int protocol_version, const std::vector& parameters) { diff --git a/database.cc b/database.cc index 3c7d936026..8e5dd6e2bf 100644 --- a/database.cc +++ b/database.cc @@ -278,7 +278,7 @@ struct uuid_type_impl : abstract_type { // FIXME: isCompatibleWith(uuid) }; -thread_local shared_ptr int_type(make_shared()); +thread_local shared_ptr int32_type(make_shared()); thread_local shared_ptr long_type(make_shared()); thread_local shared_ptr ascii_type(make_shared("ascii")); thread_local shared_ptr bytes_type(make_shared());