transport: Use constant for CQL version

There's a CQL version constant in query processor. Use it when
advertising CQL version to clients.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
This commit is contained in:
Pekka Enberg
2015-03-18 09:30:17 +02:00
parent 44f48adc85
commit 9d17a4e6da
3 changed files with 5 additions and 4 deletions

View File

@@ -38,6 +38,8 @@ using namespace transport::messages;
thread_local logging::logger log("query_processor");
const sstring query_processor::CQL_VERSION = "3.2.0";
future<::shared_ptr<result_message>>
query_processor::process(const sstring_view& query_string, service::query_state& query_state, query_options& options)
{

View File

@@ -45,9 +45,9 @@ private:
public:
query_processor(service::storage_proxy& proxy, distributed<database>& db) : _proxy(proxy), _db(db) {}
#if 0
public static final SemanticVersion CQL_VERSION = new SemanticVersion("3.2.0");
static const sstring CQL_VERSION;
#if 0
public static final QueryProcessor instance = new QueryProcessor();
#endif
private:

View File

@@ -506,8 +506,7 @@ future<> cql_server::connection::write_ready(int16_t stream)
future<> cql_server::connection::write_supported(int16_t stream)
{
std::multimap<sstring, sstring> opts;
opts.insert({"CQL_VERSION", "3.0.0"});
opts.insert({"CQL_VERSION", "3.2.0"});
opts.insert({"CQL_VERSION", cql3::query_processor::CQL_VERSION});
opts.insert({"COMPRESSION", "snappy"});
auto response = make_shared<cql_server::response>(stream, cql_binary_opcode::SUPPORTED);
response->write_string_multimap(opts);