From 2d7c3228052900a727790759d64e30ddd5fb9a32 Mon Sep 17 00:00:00 2001 From: Duarte Nunes Date: Tue, 19 Jul 2016 23:39:02 +0000 Subject: [PATCH] thrift: Actually concatenate strings This patch fixes concatenating a char[] with an int by using sprint instead of just increasing the pointer. Signed-off-by: Duarte Nunes Message-Id: <1468971542-9600-1-git-send-email-duarte@scylladb.com> (cherry picked from commit 64dff69077cf6f5847ec3b63db4ac8e6f6ec5abe) --- thrift/handler.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/thrift/handler.cc b/thrift/handler.cc index e381d86ae1..e68226209d 100644 --- a/thrift/handler.cc +++ b/thrift/handler.cc @@ -1104,7 +1104,7 @@ private: builder.with_column(to_bytes(cf_def.key_alias), std::move(pk_types.back()), column_kind::partition_key); } else { for (uint32_t i = 0; i < pk_types.size(); ++i) { - builder.with_column(to_bytes("key" + (i + 1)), std::move(pk_types[i]), column_kind::partition_key); + builder.with_column(to_bytes(sprint("key%d", i + 1)), std::move(pk_types[i]), column_kind::partition_key); } } } else { @@ -1120,7 +1120,7 @@ private: auto ck_types = std::move(p.first); builder.set_is_compound(p.second); for (uint32_t i = 0; i < ck_types.size(); ++i) { - builder.with_column(to_bytes("column" + (i + 1)), std::move(ck_types[i]), column_kind::clustering_key); + builder.with_column(to_bytes(sprint("column%d", i + 1)), std::move(ck_types[i]), column_kind::clustering_key); } auto&& vtype = cf_def.__isset.default_validation_class ? db::marshal::type_parser::parse(to_sstring(cf_def.default_validation_class))